I use a Linqdatasource to query from MSSQL DB. I use a Gridview to display data and filter from Linqdatasource. I am developing ASP.NET using (VB.NET) in VS2010. Still a begineer.
The problem I have is that when the filter is too high, there are no records returned. This made the Gridview "disappear" .
This is a problem because for every update, I will read a value from a cell in the gridview (Gridview1.rows(1).cell(0).Text). Thus, when the gridview is gone, my reading will not work and gives error.
1) How do I capture the event that there are no records returned?
2) How do I get to read a value from the recordset (after filtering) from the Linqdatasource, before displaying to the Gridview?
I have searched but there were no satisfactory answers around the net.
jayceasp
0 Points
8 Posts
Linqdatasource and Gridview Events To Capture
Jan 16, 2013 12:35 PM|LINK
Hi,
I use a Linqdatasource to query from MSSQL DB. I use a Gridview to display data and filter from Linqdatasource. I am developing ASP.NET using (VB.NET) in VS2010. Still a begineer.
The problem I have is that when the filter is too high, there are no records returned. This made the Gridview "disappear" .
This is a problem because for every update, I will read a value from a cell in the gridview (Gridview1.rows(1).cell(0).Text). Thus, when the gridview is gone, my reading will not work and gives error.
1) How do I capture the event that there are no records returned?
2) How do I get to read a value from the recordset (after filtering) from the Linqdatasource, before displaying to the Gridview?
I have searched but there were no satisfactory answers around the net.
Please help.
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Linqdatasource and Gridview Events To Capture
Jan 18, 2013 12:38 AM|LINK
What do you mean by "too high"?
Can you list for us about your detail codes?
TheHoboLord
Member
12 Points
6 Posts
Re: Linqdatasource and Gridview Events To Capture
Mar 15, 2013 07:27 PM|LINK
It maybe this issue I had.
I found that the gridview gets stored in the viewstate.
which means if you bind in this Event:
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
It should display your grid, unless something is wrong with the query.
Hope that Helps!