DataGrid like the Processes Tab?

N

NBB

My windows form has three textboxes, two buttons, and one datagrid
bound to a datatable. When the user enters text into the three
textboxes, then clicks the "Add" button, the data from the textboxes
will populate the datatable and instantly be displayed in the 3 column
datagrid below as a new row of data. When they select an item in the
datagrid and click the "Remove" button, the selected item is deleted
from the grid. So far so good.

Now, the user can also edit the items in the datagrid directly (add,
change or delete), bypassing the textboxes. I can disable this by
making the datagrid read-only. But it still allows for clicking on an
item in a column and selecting its text. I'd rather it didn't.

I'm essentially looking to make it work like the Processes tab of the
Task Manager. Just a columnar list of data, that when any item in a
row is clicked, the entire row is simply selected, not focused for
editing.

Perhaps I'm missing something in the datagrid that will make it act
like this? Or perhaps I'm using the wrong control altogether?
 
G

Guest

I am not an expert in the datagrid (as I am having problems deleteing a row where the currentRowIndex is still pointing to it) but there are events for when editing an item and I suggest that you select the row as this seems to stop the editing

----- NBB wrote: ----

My windows form has three textboxes, two buttons, and one datagri
bound to a datatable. When the user enters text into the thre
textboxes, then clicks the "Add" button, the data from the textboxe
will populate the datatable and instantly be displayed in the 3 colum
datagrid below as a new row of data. When they select an item in th
datagrid and click the "Remove" button, the selected item is delete
from the grid. So far so good

Now, the user can also edit the items in the datagrid directly (add
change or delete), bypassing the textboxes. I can disable this b
making the datagrid read-only. But it still allows for clicking on a
item in a column and selecting its text. I'd rather it didn't

I'm essentially looking to make it work like the Processes tab of th
Task Manager. Just a columnar list of data, that when any item in
row is clicked, the entire row is simply selected, not focused fo
editing

Perhaps I'm missing something in the datagrid that will make it ac
like this? Or perhaps I'm using the wrong control altogether
 

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