odd DataGrid behaviour

K

kfrank

My form creates a DataGrid named 'grid' at runtime, assigns a DataTable named
'InvDT' as the grid's .DataSource, and then positions the grid on the form.
The form then lets user do various things, which result in one or more rows
being added to the 'InvDT' DataTable. Everything's working grand, data shows
up in the grid automatically.

But, I'm trying to add an EDIT menu-function for the current-row (if any) in
the grid. And, no matter what row is highlighted in the grid, the value for
'grid.CurrentRowIndex' is ALWAYS -1.

I've used DataGrids before and never experienced this before, but those
datagrids were always placed on the form at design-time. Am I missing
something obvious? One other detail: the 'InvDT' datatable starts out with
columns defined, but no rows in it, at the time when it is set to the grid's
..DataSource.
 
K

kfrank

Doh, a few details are always nice...

Studio2005, c#, targetting PocketPC 2003. Problem occurs whether I'm
stepping thru via debug in the emulator, or either of 2 WindowsMobile5
devices.
 

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

Top