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
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