Re: bound Datagrid and Dataset - update??
- From: "ClayB [Syncfusion]" <clayb@xxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 05:21:11 -0400
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
>>
>>
>
>
.
- References:
- bound Datagrid and Dataset - update??
- From: Darryn
- Re: bound Datagrid and Dataset - update??
- From: ClayB [Syncfusion]
- bound Datagrid and Dataset - update??
- Prev by Date: Re: DataGridTextBox Question
- Next by Date: msgbox empty / blank in visual studio
- Previous by thread: Re: bound Datagrid and Dataset - update??
- Next by thread: msgbox empty / blank in visual studio
- Index(es):
Relevant Pages
|