datagrid question (index out of range)

  • Thread starter Thread starter J
  • Start date Start date
J

J

Hi,
I have a datagrid in windows form, user can using arror keys move around in
datagrid. But now, say, has 21 rows in the datagrid, if they move cursor to
22rd row, they got IndexOutOfRangeException. How can I avoid this?

Thanks in advance.
 
Bind to a dataview (instead of whatever your using) and set AllowNew = False.
 
J,

I know this behaviour with a completly empty datasource, however not as you
told it, can you show us some code where you fill the datasource of your
grid?

(Or is it all designer done?)

Cor
 

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

Back
Top