DataGrid Again

  • Thread starter Thread starter Roy
  • Start date Start date
R

Roy

I am still having problems with a datagrid. As I said before, this is my
first attempt at an ASP.Net (or any asp) application.
I have a grid that is bound to a dataset. This grid is populated in the
Page_Load event. The grid allows paging and itr works correctly.
I have another grid that is also populated by a dataset. This dataset is
filled as the result of a stored procedure and a user defined parameter. The
dataset is filled in a button_Click event. At first, when the button was
clicked, the grid would populate and be visible. However, whne the next
event was pressed I could see the progress bar moving but the data in the
grid did not change.
After much work, including deleting the grid and building a new one, the
grid is no longer visible. I even move the fill to the page_load event and
gave the proc a parameter value. The dataset fills but, the grid is not
visible.
What I am doing should be possible, isn't it? I am trying to follow examples
in a book but, I cannot get this to work.
I will be more than happy to show as much code as would be helpful.
I cannot tell you how much your help would be appreciated.
Thanks,
Roy
 
This post looks strangely familiar. The dataset only makes an appearance if
there is data to be displayed. Your code should be like this:

if(DataGrid1 != null && DataGrid1.Tables[0].Rows.Count > 0)
use the data set
else
display a message informing the user that there is no data
 
The dataset has 49 rows.

Alvin Bruney said:
This post looks strangely familiar. The dataset only makes an appearance if
there is data to be displayed. Your code should be like this:

if(DataGrid1 != null && DataGrid1.Tables[0].Rows.Count > 0)
use the data set
else
display a message informing the user that there is no data

--
Regards,
Alvin Bruney
Got tidbits? Get it here...
http://tinyurl.com/2bz4t
Roy said:
I am still having problems with a datagrid. As I said before, this is my
first attempt at an ASP.Net (or any asp) application.
I have a grid that is bound to a dataset. This grid is populated in the
Page_Load event. The grid allows paging and itr works correctly.
I have another grid that is also populated by a dataset. This dataset is
filled as the result of a stored procedure and a user defined parameter. The
dataset is filled in a button_Click event. At first, when the button was
clicked, the grid would populate and be visible. However, whne the next
event was pressed I could see the progress bar moving but the data in the
grid did not change.
After much work, including deleting the grid and building a new one, the
grid is no longer visible. I even move the fill to the page_load event and
gave the proc a parameter value. The dataset fills but, the grid is not
visible.
What I am doing should be possible, isn't it? I am trying to follow examples
in a book but, I cannot get this to work.
I will be more than happy to show as much code as would be helpful.
I cannot tell you how much your help would be appreciated.
Thanks,
Roy
 
Back
Top