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
980
Binding one column from DataView DataTable to WebDropDown
posted

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

Parents Reply Children
No Data