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

Select Max ID from RadGrid

2 Answers 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aret
Top achievements
Rank 1
Aret asked on 16 Jul 2012, 01:34 PM
I have a RadGrid that displays on a page, but I would like to get the Max ID of the rows within the Grid.  Right now I am looping through the items within the grid using the code below....

     For Each item As GridDataItem In RadGrid_ProviderReferrals.MasterTableView.Items

     Next


I think that is where I need to start, but I do not know how to pull the Max ID.

Any help would be appreciated.

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 17 Jul 2012, 04:41 AM
Hello Aret,

I am not quite sure about your requirement. One suggestion is you can set ID as the DataKeyValue. Here is the sample code.
aspx:
<MasterTableView DataKeyNames="ID">
VB:
For Each item As GridDataItem In RadGrid1.MasterTableView.Items
    Dim val As String = item.GetDataKeyValue("EmployeeID").ToString()
Next

Thanks,
Shinu.
0
Aret
Top achievements
Rank 1
answered on 02 Aug 2012, 11:42 AM
Sorry for the late reply, but I want to verify that is the answer I was looking for.

Thank You
Tags
Grid
Asked by
Aret
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Aret
Top achievements
Rank 1
Share this question
or