Hi
I have a grid column with dropdownlist style. I have the below function to return a valuelist from a data source. How can I now assign this valuelist to the grid dropdownlist column?
Thanks
Regards
Function GetStringValueList(ByVal St As String, ByVal Fld As String) As ValueList Dim Cmd As OleDb.OleDbCommand Dim Reader As OleDb.OleDbDataReader Dim StrValue As String
Cmd = New OleDb.OleDbCommand(St, LocalConn) Reader = Cmd.ExecuteReader()
Dim valuelist1 As New ValueList() While (Reader.Read()) StrValue = CStr(IIf(Reader.GetString(Reader.GetOrdinal(Fld)) Is Nothing, "", Reader.GetString(Reader.GetOrdinal(Fld)))) valuelist1.ValueListItems.Add(StrValue) End While valuelist1.ValueListItems.Add("All")
GetStringValueList = valuelist1 End Function
Forgive me if I am oversimplifying this but UltraGridColumn exposes a ValueList property, so you would assign the value returned from this method to that property.