datagrid items.count = 0 even though grid is full

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?
 
T

tommytash

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top