datagrid items.count = 0 even though grid is full

  • Thread starter Thread starter tommytash
  • Start date Start date
T

tommytash

Hi,
I have a datagrid with a checkbox column, and when, after the user
clicks a button, I do the famous "for each (datagriditem variable) in
datagrid.items....next", the datagrid.items.count is 0, even though
the datagrid.columns has the right number of columns from it's
datasource.
If I called this right after the datagrid is loaded, it has items and
works fine. It's when it's called after 1) the grid is loaded, and 2)
the button is clicked, for some reason, it has columns, but no
items.
Anyone have an idea what would cause this?
 
Is the ViewState enabled?

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]http://msmvps.com/blogs/egoldinhttp://usableasp.net




Hi,
I have a datagrid with a checkbox column, and when, after the user
clicks a button, I do the famous "for each (datagriditem variable) in
datagrid.items....next", the datagrid.items.count is 0, even though
the datagrid.columns has the right number of columns from it's
datasource.
If I called this right after the datagrid is loaded, it has items and
works fine. It's when it's called after 1) the grid is loaded, and 2)
the button is clicked, for some reason, it has columns, but no
items.
Anyone have an idea what would cause this?- Hide quoted text -

- Show quoted text -

that was it!
Thanks!
 
Back
Top