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

How to get the right grid?

2 Answers 107 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Goran
Top achievements
Rank 1
Goran asked on 21 Mar 2013, 11:29 AM
Hi,

We have ASP.NET application that has master page that contains content page with master/detail grids. Master grid can be 1 while detail grids can be more. Detail grids are placed in separate rad tabs. In every grid we have context menu where from we start exporting grid data to Excel.

The handler for exporting is placed to master page.

The question is how can we get the reference of right grid in master page handler? For example, we have 1 master grid and 2 detail grids in 2 rad tabs below. We can click context menu option in first detail grid, but how do we know it's first detail grid?


Thank you in advance,

Goran

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 21 Mar 2013, 11:59 AM
Hi,

You can get reference for the detailtable as shown below.
C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
        if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "DetailTable1")
        {
        }
}

Thanks,
Princy
0
Goran
Top achievements
Rank 1
answered on 21 Mar 2013, 12:10 PM
Actually we need to write the code in post back button event handler in master page as following:

protected void PostbackButtonClick(object sender, EventArgs e)
{
    // The code goes here
}
Tags
Grid
Asked by
Goran
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Goran
Top achievements
Rank 1
Share this question
or