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

Help: Need to know if the grid is in detailview

2 Answers 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 24 May 2012, 05:54 PM
Is there a quick way to tell if an e.item is in detail view?  I'm having problem with ItemDataBound  and ItemCreated not finding the columns because it in detail view.  I just want to check if it's in detail view and skip the code.

Thank you in advance for you help.

2 Answers, 1 is accepted

Sort by
0
Paul
Top achievements
Rank 1
answered on 24 May 2012, 06:03 PM
You can check the e.Item.OwnerTableView.Name of the detail table... But was just wondering if their was something like e.Item isDetailView or something around that line.
0
Shinu
Top achievements
Rank 2
answered on 25 May 2012, 05:46 AM
Hello Paul,

You can check for the detailtableview only using its Name property.
C#:
protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridDataItem && e.Item.OwnerTableView.Name == "DetailTable1")
 {
  GridTableView detailTable = (GridTableView)e.Item.OwnerTableView;
 }
}

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