473,756 Members | 4,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid save editing rows

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
Nov 17 '05 #1
3 3827
Hi Islameguy,

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

On Sat, 17 Sep 2005 11:14:34 +0200, Islamegy <is******@yahoo .com> 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]
Nov 17 '05 #2
i tried it and didn't work with shouldAbort =false or true...

dataGrid2.EndEd it(dataGrid2.Ta bleStyles[0].GridColumnStyl es[dataGrid2.Curre n
tCell.ColumnNum ber],dataGrid2.Curr entRowIndex,fal se);

have any other ideas??
"Morten Wennevik" <Mo************ @hotmail.com> wrote in message
news:op.sw8qcxf hklbvpo@stone.. .
Hi Islameguy,

I think if you call DataGrid.EndEdi t in your button event and speficy false for shouldAbort the changes are saved.
On Sat, 17 Sep 2005 11:14:34 +0200, Islamegy <is******@yahoo .com> 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]

Nov 17 '05 #3
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#@#yah oo#.#com> wrote:
i tried it and didn't work with shouldAbort =false or true...

dataGrid2.EndEd it(dataGrid2.Ta bleStyles[0].GridColumnStyl es[dataGrid2.Curre n
tCell.ColumnNum ber],dataGrid2.Curr entRowIndex,fal se);

have any other ideas??
"Morten Wennevik" <Mo************ @hotmail.com> wrote in message
news:op.sw8qcxf hklbvpo@stone.. .
Hi Islameguy,

I think if you call DataGrid.EndEdi t in your button event and speficy

false for shouldAbort the changes are saved.

On Sat, 17 Sep 2005 11:14:34 +0200, Islamegy <is******@yahoo .com> 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]
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2547
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called "Resource" with the following structure : Resource{,en,fr,es} Yes.. these are the only languages supported actually. A couple of rows in that table would look like this :
1
15751
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template columns to show some of the columns. Few of the columns have textboxes to make them available for editing. I am trying to update the dataset all at once using one update button. Here is my code... (for simplicity I have only listed one of the...
1
2907
by: GregM | last post by:
I have a read only datagrid that is designed to coordinate itself with textboxes. When the user clicks on a row in the datagrid, detailed data for that row is displayed for editing in the textboxes. The datagrid and textboxes are populated from the same underlying SQL Server table but using different strongly typed data adapters and datasets for display and editing. So I coordinate syncronization of the two sets of data using code. I use...
4
5357
by: Glenn Owens | last post by:
I have a DataGrid web control which I've dynamically populated with template columns to be used for bulk-editting. Generally, all of the columns are textbox and/or dropdownlist child controls. Currently everything is working. I can find the updated rows/columns by parsing the posted data collection against the DataGrid DataSource. However, when there is a large amount of DataGridItems (rows) the update processing can take a while. ...
3
4883
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
7
3531
by: uiranejeb | last post by:
Hi everybody, I am an asp.net datagrid that have all the rows editable. An user can update any column from datagrid. I'm trying to find a way to update only the rows that were updated. How can I handle this? Is there any possibility to get data row behind datagrid row?
1
1870
by: Amadelle | last post by:
Hi all and thanks in advance for your help, I have a problem with capturing the changed value of a text box in a datagrid. The datagrid is populated based on a dataset and I am using template columns to show some of the columns. Few of the columns have textboxes to make them available for editing. I am trying to update the dataset all at once using one update button. Here is my code... (for simplicity I have only listed one of the...
7
1787
by: Joe | last post by:
Hi, I’m new to asp.net. I want to create an asp.net page that allows user to edit the data. I have pasted my code below. I am able to display the data in a datagrid. At the bottom of the page there are two buttons “Save Changes” and “Cancel”. When “Save Changes” button is clicked saveRec function is called. But for some reason inside saveRec function the value of the textbox is not visible. The line Label2.Text =...
0
1308
by: hanusoft | last post by:
This is an example of editing in DataGrid and Default Paging http://www.hanusoftware.com Html Design Code : - <asp:DataGrid id="DataGrid1" DataKeyField="id" runat="server" Height="224px" AutoGenerateColumns="False" PageSize="5" AllowPaging="True"> <Columns> <asp:BoundColumn Visible="False" DataField="id" HeaderText="Category Id"></asp:BoundColumn>
0
9152
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9571
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8569
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6410
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4996
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3185
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2542
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.