This is a migrated thread and some comments may be shown as answers.

Populate Radgrid popup edit form textbox from a lookup table

1 Answer 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
daniele
Top achievements
Rank 1
daniele asked on 05 May 2011, 09:18 AM
Sorry for my very bad italian/english.
I'm quite new to .NET and Telerik.
I have a RadGrid control in which I perform edit and insert by using the Radgrid modal popup.
Some of the columns are edit/insert column template, and I can populate the textboxes by using RadDatePicker, Combobox ...
I would like some fields in the edit popup to be populated from data picked doubleclicking on another RadGrid (let's say it's in a RadWindow opened by a RadButton near the textbox).
How can I perform data transfer between RadWindow and edit/insert popup of the first RadGrid?
Thank you

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 06 May 2011, 07:00 AM
Hello Daniele,

 In order to achieve your requirement, access the edit/insert row of first grid(from corresponding event of second grid) and set value to textbox in insert/edit form. The following code snippet shows how to access the edit/insert row.

C#:
GridEditFormItem editItem = (GridEditFormItem)RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)[editIndex];//getting edit row
 TextBox txtbox = (TextBox)editItem.FindControl("TextBox1");
txtbox.Text = "your value";
if (RadGrid1.MasterTableView.IsItemInserted)
    {
      GridEditFormInsertItem insertItem=(GridEditFormInsertItem)RadGrid1.MasterTableView.GetInsertItem();//accessing insert form
      //your code
    }

Thanks,
Princy.
Tags
Grid
Asked by
daniele
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or