PC Review


Reply
Thread Tools Rate Thread

DataGrid save editing rows

 
 
Islamegy
Guest
Posts: n/a
 
      17th Sep 2005
When i press btn_save all changed rows in my grid get saved except the last
editing row...

I want my btn_Save to end editing in the datagrid.. so if user didn't press
"enter" after editing last cell of the current row, I could force this row
to be saved in the datasource.

help plz


 
Reply With Quote
 
 
 
 
Morten Wennevik
Guest
Posts: n/a
 
      17th Sep 2005
Hi Islameguy,

I think if you call DataGrid.EndEdit in your button event and speficy false for shouldAbort the changes are saved.

On Sat, 17 Sep 2005 11:14:34 +0200, Islamegy <(E-Mail Removed)> wrote:

> When i press btn_save all changed rows in my grid get saved except the last
> editing row...
>
> I want my btn_Save to end editing in the datagrid.. so if user didn't press
> "enter" after editing last cell of the current row, I could force this row
> to be saved in the datasource.
>
> help plz
>
>
>




--
Happy coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
 
Islamegy
Guest
Posts: n/a
 
      17th Sep 2005
i tried it and didn't work with shouldAbort =false or true...

dataGrid2.EndEdit(dataGrid2.TableStyles[0].GridColumnStyles[dataGrid2.Curren
tCell.ColumnNumber],dataGrid2.CurrentRowIndex,false);

have any other ideas??


"Morten Wennevik" <(E-Mail Removed)> wrote in message
newsp.sw8qcxfhklbvpo@stone...
> Hi Islameguy,
>
> I think if you call DataGrid.EndEdit in your button event and speficy

false for shouldAbort the changes are saved.
>
> On Sat, 17 Sep 2005 11:14:34 +0200, Islamegy <(E-Mail Removed)> wrote:
>
> > When i press btn_save all changed rows in my grid get saved except the

last
> > editing row...
> >
> > I want my btn_Save to end editing in the datagrid.. so if user didn't

press
> > "enter" after editing last cell of the current row, I could force this

row
> > to be saved in the datasource.
> >
> > help plz
> >
> >
> >

>
>
>
> --
> Happy coding!
> Morten Wennevik [C# MVP]



 
Reply With Quote
 
Morten Wennevik
Guest
Posts: n/a
 
      17th Sep 2005
Not sure what the problem might be. I created a simple datagrid sample using a database as source and updating using SqlDataAdapter.Update(DataSet). Any DataGrid cell being edited is saved when the Update button is pressed. I used VS.Net 2003 and MSDE, with an autoconfigured SqlDataAdapter.

Could you give us a code sample demonstrating the problem? How do you update the data? How do you display/edit the data? What kind of datasource do you use?


On Sat, 17 Sep 2005 12:39:04 +0200, Islamegy <islamegy#@#yahoo#.#com> wrote:

> i tried it and didn't work with shouldAbort =false or true...
>
> dataGrid2.EndEdit(dataGrid2.TableStyles[0].GridColumnStyles[dataGrid2.Curren
> tCell.ColumnNumber],dataGrid2.CurrentRowIndex,false);
>
> have any other ideas??
>
>
> "Morten Wennevik" <(E-Mail Removed)> wrote in message
> newsp.sw8qcxfhklbvpo@stone...
>> Hi Islameguy,
>>
>> I think if you call DataGrid.EndEdit in your button event and speficy

> false for shouldAbort the changes are saved.
>>
>> On Sat, 17 Sep 2005 11:14:34 +0200, Islamegy <(E-Mail Removed)> wrote:
>>
>> > When i press btn_save all changed rows in my grid get saved except the

> last
>> > editing row...
>> >
>> > I want my btn_Save to end editing in the datagrid.. so if user didn't

> press
>> > "enter" after editing last cell of the current row, I could force this

> row
>> > to be saved in the datasource.
>> >
>> > help plz
>> >
>> >
>> >

>>
>>
>>
>> --
>> Happy coding!
>> Morten Wennevik [C# MVP]

>
>
>




--
Happy coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with nested datagrid and editing all rows in it Vili Microsoft ASP .NET 1 31st Mar 2006 04:00 PM
DataSet - Errors editing rows after using InsertAt() - DataGrid Bo =?Utf-8?B?RGF2ZQ==?= Microsoft C# .NET 0 15th Aug 2005 10:05 PM
DataSet - Errors editing rows after using InsertAt() - DataGrid Bo =?Utf-8?B?RGF2ZQ==?= Microsoft Dot NET 5 15th Aug 2005 08:10 PM
save record in datagrid while still editing jaYPee Microsoft VB .NET 2 22nd Apr 2004 11:21 AM
help: editing rows in a datagrid Microsoft Dot NET Compact Framework 2 6th Nov 2003 06:05 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:07 AM.