What's the datagrid event when user selects a different row?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've looked through all the event members of a datagrid but I can't find one
that's for when user selects a different row in the datagrid. How does one
catch this type of event?

Thanks, Alpha
 
Alpha,

You want to sign up for the CurrentCellChanged event. It will fire any
time the cell is changed. You just have to check to see if the row on the
cell changed.

Hope this helps.
 
Thanks again Nicholas.

Nicholas Paldino said:
Alpha,

You want to sign up for the CurrentCellChanged event. It will fire any
time the cell is changed. You just have to check to see if the row on the
cell changed.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alpha said:
I've looked through all the event members of a datagrid but I can't find
one
that's for when user selects a different row in the datagrid. How does
one
catch this type of event?

Thanks, Alpha
 
Nicholas,

I need to save the changes in the textbox (on the same form) to the dataset
table and then use SqlDataAdapter.update when user choose a different row on
the datagrid or close the form.

Now I know which row they're on(that should still be the current row,
right?) when the user click on another row but how do I pin-point which row
in the dataset table that I should assign the textbox.text to ? The row
number in the datagrid, that doesn't mapped to the row number of the dataset
table, does it?

Thanks, Alpha

Nicholas Paldino said:
Alpha,

You want to sign up for the CurrentCellChanged event. It will fire any
time the cell is changed. You just have to check to see if the row on the
cell changed.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Alpha said:
I've looked through all the event members of a datagrid but I can't find
one
that's for when user selects a different row in the datagrid. How does
one
catch this type of event?

Thanks, Alpha
 
Back
Top