Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
Assigning items to a grid column with dropdown list style
posted

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

Parents
No Data
Reply
  • 69832
    Offline posted

    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.

Children
No Data