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
595
Add dropdownlist control to a web grid column at runtime?
posted

Hi, I'm trying to add a dropdown listbox into a column within the webdatagrid at run time.

I don't seem to be able to link the provider to the column.

Code:

       ' create ddl editor provider
        Dim provider1 As New Infragistics.Web.UI.GridControls.DropDownProvider
        provider1.ID = "DropdownlistProvider"
        provider1.EditorControl.Items.Add(New Infragistics.Web.UI.ListControls.DropDownItem("INVOICE"))
        provider1.EditorControl.Items.Add(New Infragistics.Web.UI.ListControls.DropDownItem("CREDIT"))


        ' assign provider to Invoice_Type column.
        Dim editor2 As New EditingColumnSetting(WebDataGrid1)
        editor2.ColumnKey = "Invoice_Type"
        editor2.EditorID = "WebDataGrid1_DropDownProvider1" ' works, this is setup in html!!
        editor2.EditorID = "DropdownlistProvider" ' doesn't work, setup in code above.
        WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(editor2)

 

Thanks for the help,

Graham.