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 });

Parents
  • 13438
    posted

    Hello,

    I assume issue comes when the editor is being loaded. The editor is being loaded with the new items for the drop down in the entered edit mode event. By this point, the editor has already had its value set from the cell. So it tried to set the value to new value to the corresponding cell, but that value is not in the drop down item list yet. So either the editor needs to be loaded before entering edit mode or the value needs to be set afterwards (in response complete), or after edited mode. Can you provide information like what is your exact build and if it is possible to attach an aspx+c# page sample of what exactly you are trying to achieve and your implementation? Also am I right to understand that you are using asp DropDownList instead of our WebDropDown?

Reply Children