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
515
Issue with RowEditingClientBinding event
posted

We have built our own custom control that has a WebHierarchicalDataGrid.  We are building columns and our edit template dynamically.

 Inside of our Edit Template we have a Dropdownlist.  When the edit template closes it updates the appropriate cell,  but the cell displays the valueField from the dropdown but we need it to display textfield.

 

 

We dynamically add RowEditingClientBinding to our behaviors:

getValueJavaScript = "$get('" + clientId + "').value";

setValueJavaScript = "$get('" + clientId + "').value={value}";

 

                 var item = new RowEditingClientBinding

                    {

                        ColumnKey = dataFieldName,

                        ControlID = clientId,

                        GetValueJavaScript = getValueJavaScript,

                        SetValueJavaScript = setValueJavaScript

                       

                    };

                   Grid.GridView.Behaviors.EditingCore.Behaviors.RowEditTemplate.ClientBindings.Add(item);

 

Our columns is a bound column in the grid and  uses an editorprovider with a DropDownProvider inside of it.

 

var ddlProvider = ((DropDownProvider)Grid.EditorProviders["ddProvider"]).EditorControl;

ddlProvider.DataSource = dt;

ddlProvider.DataBind();

 

Grid.GridView.Behaviors.CreateBehavior<EditingCore>();

Grid.GridView.Behaviors.EditingCore.Behaviors.CreateBehavior<CellEditing>();

Grid.GridView.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(new EditingColumnSetting { ColumnKey = dataFieldName, ReadOnly = readOnly, EditorID = ddlProvider.ID });