Hello,
I'm using dropDownProvider in whdg. I want to bind ddp to datasource, which is dataview (to be exact, to one of the columns of DataTable from DataSource). For ultrawebgrid it could be done like this
UltraWebGrid1.Columns[2].Type = ColumnType.DropDownList;UltraWebGrid1.Columns[2].ValueList.DataSource = dv;UltraWebGrid1.Columns[2].ValueList.DisplayMember = "Name";UltraWebGrid1.Columns[2].ValueList.ValueMember = "Name";UltraWebGrid1.Columns[2].ValueList.DataBind();
I tried this
this.DropDownProvider1.EditorControl.DataSource = dv; this.DropDownProvider1.EditorControl.DataMember = "Name"; this.DropDownProvider1.EditorControl.DataBind();
But it throws "System.InvalidOperationException" exception on DataBind(). I also tried ValueField instead of DataMember, but then it displays empty strings
Hi Andrey,
I would suggest you to get the editor and set data source like this:
WebDropDown editor = (WebDropDown)WebHierarchicalDataGrid1.EditorProviders["DropDownProvider1"].GetEditor(); editor.DataSource = dv; editor.DataMember = "Name";
Let me know if this helps.