OnItemCreated with datagrid paging enabled...

wizzie

New Member
Hi all, <BR><BR>I have a DataGrid with AllowPaging="True". I also have an OnItemCreated event handler in my DataGrid. Here is the sub... <BR><BR>Public Sub Item_Created(Sender As Object, E As DataGridItemEventArgs) <BR>Dim TC As TableCell = E.Item.Cells(1) <BR>TC.Attributes("title") = "View Category" <BR>End Sub <BR><BR>When the DG reaches the row with paging, an error is thrown... <BR><BR>Ex.Message reads: <BR>Specified argument was out of the range of valid values. Parameter name: index <BR><BR>Has anyone else run into this problem? How can I fix it? <BR><BR>Thanks, <BR>D.I figured it out. Simply wrap your code in:<BR><BR>If (E.Item.ItemType <> ListItemType.Pager) Then<BR>'your code<BR>End If<BR><BR>Cheers,<BR>David
 
Back
Top