Hello
I am using radgrid 5.1.2. I am binding the grid to a List(of Pair) objects. Here is the code to bind the grid
At this point the dataItem object is nothing. I don't understand why this is. I tried the same thing using an array of string and the data item was still nothing.
Please can you helpme fix this
thanks
I am using radgrid 5.1.2. I am binding the grid to a List(of Pair) objects. Here is the code to bind the grid
Dim stockList As List(Of Pair) = CType(Session("StockList"), List(Of Pair))
stockList.Insert(0,
New Pair(stockCode, stockType))
dgStock.DataSource = stockList
dgStock.DataBind()
I have checked that the stock list definitely has some items in it at this point. In the item data bound event however it is saying the data item is not set to an instance of an object. Here is the code
Protected Sub dgStock_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.WebControls.GridItemEventArgs) Handles dgStock.ItemDataBound
If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
Throw New Exception(e.Item.DataItem Is Nothing) <====says TRUE
At this point the dataItem object is nothing. I don't understand why this is. I tried the same thing using an array of string and the data item was still nothing.
Please can you helpme fix this
thanks