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

Populate radgrid from another radgrid

1 Answer 122 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rohit
Top achievements
Rank 1
rohit asked on 07 Jan 2011, 06:06 AM
On my web page, i have one radgrid1 which is pre-populating.
On same page, i have a search functionality on a button, which popup a window and populates a radgrid2 on some search criteria.
radgrid2 have link button in item template column,  now when i click on link button i want to populate my radgrid1 with the selected row data from radgrid2.

Any help is appreciated.

It is very urgent. Pls Help.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jan 2011, 08:33 AM
Hello Rohit,


If you are using ContentTemplate of RadWindow to show the readgrid2, then you can directly access the radgrid1 in the LinkButton click event handler (when using ContentTemplate, the RadWindow acts as Container control, means all the controls rendered on the page).


Access the corresponding data key value for the row in ButtonClick event using following code and populate the radgrid1 accordingly.
Code:
protected void LinkButton1_Click(object sender, EventArgs e)
{
    LinkButton lnkButon = (LinkButton)sender;
    GridDataItem item = (GridDataItem)lnkButon.NamingContainer;
    string value = item["ColumnUniqueName"].ToString();
    // Access the radgrid1 and populate it based on 'value'
}
 

 -Shinu.
Tags
Grid
Asked by
rohit
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or