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

ItemIndex always 0

3 Answers 112 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Adonis
Top achievements
Rank 1
Adonis asked on 01 Nov 2010, 01:53 AM
is there a way to retrieve the item index from a RadGrid without going through a command item? What I need to accomplish is just for example (code below) but the ItemIndex always returns as 0 

Public Sub Test ()
For each item as GridDataItem in RadGrid1.Items
 
Dim i as integer = item.ItemIndex  ' (Item.ItemIndex always returns as 0 )
 
Next
 
End Sub

I certain this was working before , i need to identify if the code base was changed , but any help is appreciated 

3 Answers, 1 is accepted

Sort by
0
Accepted
Pavlina
Telerik team
answered on 01 Nov 2010, 01:15 PM
Hello Adonis,

I tried the following code and it is working as expected.
C#":
protected void Grid_ItemDataBound(object sender, GridItemEventArgs e)
 {     
         int i = e.Item.ItemIndex;        
 }

Examine it and let me know if it works for you.

Regards,
Pavlina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Adonis
Top achievements
Rank 1
answered on 10 Nov 2010, 07:23 PM
Code works fine , It was the setting in my Ajax manager that were causing the issue.

thanks
0
Landon
Top achievements
Rank 2
answered on 17 May 2011, 08:11 PM
Adonis,

If you wouldn't mind (and can remember), could you share what setting you had to change on your Ajax Manager?

As I'm having the same type of problem when disabling Ajax on certain buttons.

Regards,

Landon
Tags
Grid
Asked by
Adonis
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Adonis
Top achievements
Rank 1
Landon
Top achievements
Rank 2
Share this question
or