Is it possible dynamically assign editor provider to the cell, e.g. in attached site there are two editor providers defined in grid : "wddYesNo" and "wddSvc" , wddYesNo now assigned to edit column ‘Question’ I need dynamically reassign on the client side editor “wddSvc” to the same column ‘Question’ for rows where idMaster in ( 3 , 5, 10) . Attached site so if it is possible please show me how .
Thanks.
Hello mcseidel ,
You can achieve this functionality by using only one DropDownProvider and changing its data source dynamically when the cell enter edit mode.:
protected void eProvider_ItemsRequested(object sender, DropDownItemsRequestedEventArgs e) { if (e.Value.ToString() == "1") { ((WebDropDown)sender).Items.Clear(); ((WebDropDown)sender).Items.Add(new DropDownItem() { Text = "IT Service", Value = "ITS", Selected = false }); ((WebDropDown)sender).DataBind(); } else { ((WebDropDown)sender).Items.Clear(); ((WebDropDown)sender).Items.Add(new DropDownItem() { Text = "Yes", Value = "Yes", Selected = false }); ((WebDropDown)sender).Items.Add(new DropDownItem() { Text = "No", Value = "No", Selected = false }); ((WebDropDown)sender).DataBind(); } }
For additional reference please check the attached sample which I modified on your behalf.
I was just wondering did you have a chance to try my suggestion. If you still need any assistance on the matter, please do not hesitate to ask.
What you provided works fine, but this is not switching reference of the editors on the client side but lazy loading, call to pagemethod... I have very bad experience with lazy loading on the heavy pages. Is it possible just to switch editor on the client without going back to server and rebinding control.
thanks.
Hi mcseidel ,
Thank you for the update.
Sorry, I did not have a chance, but will try next week and let you know. Thanks.