Hi ,
I Have a ultrawebgrid with paging and sorting on server.
I am filling the grid using a datareader on a button click event.
Now once the data is filled in the grid , and if the button is clicked again then the data reloads without any problem but ,
If i fill the grid and then sort it (By clicking on the column header) and then if i reload the grid (by pressing the button) the the bind data throws an exception !!!
Can anybody tell me how this can be avoided ???Or why the grid is behaving in this manner ??
I don't know if I can help, but it would be useful if I knew what exception was being thrown, and could look at the code that binds the grid and that handles the button-click event.
Code To Bind the data
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
Dim dr As SqlDataReader = Nothing
Params(0).Value = userinfo.GetValue(APPR.UserID).ToString
Params(1) = New SqlParameter("@sDate", SqlDbType.VarChar, 10)
Params(2).Value = userinfo.GetValue(APPR.HierarchyLevel)
Params(3).Value = whereqry
Dim errmsg As String = Nothing
If Connect_SQLDataReader(dr, "expt_show", errmsg, Params, CommandType.StoredProcedure) = False Then
Exit Try
End If
Me.ExptGrid.DataBind()
Me.UpdatePanel4.Update()
I have written Some code[setting the header Captions of the columns and filling values in the value lists of some columns] in the initialize layout. The Excecution runs fine before sorting !! After sorting when the same button is clicked.
DataBind is Called.
Object reference not set to an instance of an object.
Any ideas ???