telerikradgridradwindowedititemtemplate

RadGrid EditColumn Insert Data to an Edit Field from a RadGrid in a RadWindow


I have a telerik:RadGrid that contains Bound Data,

I am calling Popup Edit Control Of RadGrid, I am getting all the fields and edit works fine.

What I want to do is from the Edit Popup, Edit one of the fields (Which is a RadTextBox) by clicking a button to open a RadWindow, this Window Contains another RadGrid with user details and one of the column with a button that executes RadGrid_OnCommand event, I am passing one of the values of the Grid by:

CommandArguments='<%# Eval("UserName")%>'

How can I place this value to the RadTextBox.Text in the Edit PopUp, So that I can update the grid with the selected value?

I would really appreciate any help. Thank you in Advance


Solution

  • I solved the issue by geting the grid row, which is in edit mode so I got the value of which row I need to change and updated its Editible item by ID using this code:

            var rowid = RadGrid1.EditIndexes[RadGrid1.EditIndexes.Count-1];
            GridEditFormItem rowEditControls;
            foreach (GridDataItem row in RadGrid1.Items)
            {
    
                if (row.ItemIndex == int.Parse(rowid))
                {
                    rowEditControls = row.EditFormItem;
                    ((rowEditControls as GridEditableItem).FindControl("ID") as RadTextBox).Text = e.CommandArgument.ToString();
                }
            }
    

    I Hope this will be helpfull for someone, I find it valuable for customising your edit forms.