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

ItemDataBound

1 Answer 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 28 Dec 2010, 03:21 PM

I am trying to figure out how to determine which item parent or child grid item is being process in the ItemDataBound event.  My data set has two tables and unique names but trying to use: e.Item.OwnerTableView.DataMember does not give me the name of the table.  For the detail records I am using Dim parentItem As GridDataItem = e.Item.OwnerTableView.ParentItem to determine if it is a parent or child item but I need to change the header property but can not figure out how to do this.  I tried using Dim headeritem As GridHeaderItem = DirectCast(e.Item, GridHeaderItem) to determine parent or child but am not sure how to accomplish.

Any ideas how I can easily determine at the header level if I am processing the parent or child header?

Thanks

John

 


1 Answer, 1 is accepted

Sort by
0
Elliott
Top achievements
Rank 2
answered on 28 Dec 2010, 04:56 PM
If Typeof e.Item is GridHeaderItem
then
   do something
end if

is how to figure out what sort of item you are looking at

to find out the table
e.Item.OwnerTableView.Name is a string corresponding to the Name= on the GridTableView
give each of your levels a name and you can easily reference them

Marianne
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Elliott
Top achievements
Rank 2
Share this question
or