iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
I need to bind a different dropdown for each row in my grid in order to edit a column using this control.
I cannot use EditType="WebComboNET" or EditType="DropdownList" on my column because these edit controls are the same for each row.
So I need to use ColumnType="Template", EditType="NoEdit" and specify a custom asp dropdownlist in my CellTemplate that will be initilaized during InitializeRow event.
This dropdown includes a client-side "onChange" event:
function ddl_change(ddlClientId) { var grid = ISGetObject('<%= wg.ClientID %>'); var row = grid.GetSelectedObject().GetRowObject(); var cell = row.GetCell("MyColumn"); var ddl = document.getElementById(ddlClientId); cell.SetValue(ddl.value); row.AddPendingChanges(); //row.SetDataChanged(); }
I tried several possibilities in the last 3 lines.
SetValue is needed for the pending changes summary and the batch update.
The problem is that this method removes my dropdownlist and replaces it by a simple text with all values from the dropdownlist.
Why is my dropdown disappearing? Why is the replaced text containing all my dropdown values?How do I set my selected value in order to perform the batch update?Is there another solution to do this?
Hi Nicolas,
Attached is a sample code of setting a template DropDown with different a value in each row. Please ensure that you put the .cs file on your App_code folder. If you has noticed, on the .aspx file, you will see a block of commented code. When you do un-commented these block of code, in a result, any changes in WebGrid will be counted as pending changes in BatchUpdate. However, after you change the value, the dropdown list will be disappear. That is a known issue and under investigation of our Developer team.
This is occurred because the Template cell is being overwritten with the function of AddPendingChanges of BatchUpdate process and cause it to be a regular label.
I hope it helps. Thank you and have a nice day.
Best Regards,
Andi Santoso
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname