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

How to get the number of rows in the Detailtable's ItemDataBound

1 Answer 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 2
John asked on 16 Jun 2008, 10:08 AM
I have a two level hierachie grid and in the second level I would like to add a up and down button to move item up and down.

To hide the down button, I use .visible = e.item.itemindex > 0 and it works fine

But to hide the up button, I need to know the total number of this second level instance. I used the following, but I am not sure if it is right to do this way as I could't find any other way. Kindly confirm and tell me the better way of archieving this.

Thanks -- Bidan

Dim oDV As DataView = CType(e.Item.DataItem, DataRowView).DataView
oDV.RowFilter = "ParentID= " & e.Item.OwnerTableView.ParentItem("ID").Text
Dim iTotal As Short = oDV.Count
oDV.RowFilter = ""

button.visible = e.item.itemindex< iTotal - 1

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 17 Jun 2008, 06:38 AM
Hi Bidan,

Another possible approach would be to iterate through the detail tables, and determine the number of items through the Items collection for a given detail table.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
John
Top achievements
Rank 2
Answers by
Yavor
Telerik team
Share this question
or