Re: bound Datagrid and Dataset - update??

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sorry, I left out a cast.

Try adding this code at the start of your ColumnChanged event.

CurrencyManager cm = dataGrid1.BindingContext[dataGrid1.DataSource,
dataGrid1.DataMember] as CurrencyManager;
cm.EndCurrentEdit();

=================
Clay Burch, .NET MVP

Visit www.syncfusion.com for the coolest tools


"ClayB [Syncfusion]" <clayb@xxxxxxxxxxxxxx> wrote in message
news:%23A2Z$XPZFHA.584@xxxxxxxxxxxxxxxxxxxxxxx
> Try adding this code at the start of your ColumnChanged event.
>
> CurrencyManager cm = dataGrid1.BindingContext[dataGrid1.DataSource,
> dataGrid1.DataMember];
> cm.EndCurrentEdit();
>
> =================
> Clay Burch, .NET MVP
>
> Visit www.syncfusion.com for the coolest tools
>
> "Darryn" <darryn@xxxxxxxxxxxxxxx> wrote in message
> news:ON%23vsiKZFHA.616@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi
>>
>> I am having a few problems with one of my forms... I have a data grid
>> bound
>> to a dataset using a currencymanager and it's all working fine. However
>> when
>> i edit or change any of the data in the Datagrids columns/rows i need to
>> call update so the changes are saved back to my database, this is where
>> the
>> problems being. To catch the changed event of my data i have added the
>> following events based on the Dataset Class...
>>
>> CBDataset.Tables["tbltest"].ColumnChanging += new
>> DataColumnChangeEventHandler(DGCB_ColumnChanging);
>>
>> CBDataset.Tables["tbltest"].ColumnChanged += new
>> DataColumnChangeEventHandler(DGCB_ColumnChanged) ;
>>
>> the column changing event is used to validate what has been entered and
>> the
>> column changed event i use to run my update command. When a cell is
>> changed
>> in my data grid both events fire however my update command returns 0 'the
>> state has not changed to modified'?? until i navigate either up or down
>> rows
>> in the grid?? why is this and what can i do to get it to update without
>> navigating up/down rows in the grid before the data has a rowstate of
>> modified!
>>
>> Regards
>>
>> Darryn
>>
>>
>
>


.



Relevant Pages

  • Re: bound Datagrid and Dataset - update??
    ... Visit www.syncfusion.com for the coolest tools ... > column changed event i use to run my update command. ... > in my data grid both events fire however my update command returns 0 'the ... until i navigate either up or down ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: bound Datagrid and Dataset - update??
    ... > Visit www.syncfusion.com for the coolest tools ... >> column changed event i use to run my update command. ... >> in my data grid both events fire however my update command returns 0 ... until i navigate either up or down ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: bound Datagrid and dataset - update???
    ... You may wish to work with the CurrentCellChanged event instead. ... > column changed event i use to run my update command. ... > in my data grid both events fire however my update command returns 0 'the ... until i navigate either up or down ...
    (microsoft.public.dotnet.framework.adonet)
  • Bound Datagrid and Dataset - update details???
    ... to a dataset using a currencymanager and it's all working fine. ... column changed event i use to run my update command. ... in my data grid both events fire however my update command returns 0 'the ... until i navigate either up or down rows ...
    (microsoft.public.dotnet.languages.csharp)
  • bound Datagrid and dataset - update???
    ... to a dataset using a currencymanager and it's all working fine. ... column changed event i use to run my update command. ... in my data grid both events fire however my update command returns 0 'the ... until i navigate either up or down rows ...
    (microsoft.public.dotnet.framework.adonet)