Hi,

I would like to save inserts, deletes and updates in the DataGridView bach
to the database when the user changes the current selected row. Right now I
am using the SelectionChanged event, but that fires everytime the user
changes column.

Is this really the only event I can use?

Thanks

Henrik Skak Pedersen

RE: Saving data in the DataGrid by v-kevy

v-kevy
Wed Feb 01 20:52:58 CST 2006

Hi Henrik,

How do y ou bind the DataGridView to the data source? Are you binding to a
DataSet directly, or binding to a BindingSource object?

If using a BindingSource, you can just handle the CurrentChanged or
PositionChanged event.

If you're binding to a DataSet object, please get the CurrencyManager and
handle the CurrentChanged or PositionChanged event of that CurrencyManager.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Saving data in the DataGrid by Henrik

Henrik
Thu Feb 02 10:00:38 CST 2006

Hi Kevin,

Thank you very much. I will use the CurrentChanged event.

Thanks Henrik
"Kevin Yu [MSFT]" <v-kevy@online.microsoft.com> wrote in message
news:M$EaNP6JGHA.3764@TK2MSFTNGXA02.phx.gbl...
> Hi Henrik,
>
> How do y ou bind the DataGridView to the data source? Are you binding to a
> DataSet directly, or binding to a BindingSource object?
>
> If using a BindingSource, you can just handle the CurrentChanged or
> PositionChanged event.
>
> If you're binding to a DataSet object, please get the CurrencyManager and
> handle the CurrentChanged or PositionChanged event of that
> CurrencyManager.
>
> HTH.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>



Re: Saving data in the DataGrid by v-kevy

v-kevy
Thu Feb 02 23:21:49 CST 2006

You're welcome, Henrik.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: Saving data in the DataGrid by kelly

kelly
Fri Feb 03 07:07:41 CST 2006

Hi guys,
I have a follow up question I'm hoping you can help me with. Like
Henrik, I would like to save records back to the database when I change
rows but I want to perform some validation before I save the record.
If the validation fails I want to keep the user on the row in error,
but you can't cancel the row changing event so the user is always moved
to the new row. I've put in both row changing and column changing
events but still have the problem.

Any suggestions would be appreciated.

Thanks,
Kelly Pearson


Re: Saving data in the DataGrid by Shailesh

Shailesh
Thu Mar 09 05:10:27 CST 2006

Hi Kevin,

I am facing some problems while working with Datagrid in my windows form
using c#.
I want my grid as Read only. But on a certain condition (let's say on button
click) I want to make it Updatable, but at a time only one row shold be
updatable.
How can I achieve this.

Thanks in advance.
Shailesh

"Kevin Yu [MSFT]" wrote:

> You're welcome, Henrik.
>
> Kevin Yu
> =======
> "This posting is provided "AS IS" with no warranties, and confers no
> rights."
>
>