Hi,
Suppose there is a DataGrid on a form bound to a DataTable. When a user is
editing a cell without leaving the cell, and then closes the form, the value
is not updated to the underlying data source.
How can I accomplish this?
Thanks,
--
Tom Tempelaere. 4 4269
CurrencyManager cm =
(CurrencyManage r)this.BindingC ontext[dataGrid.DataSo urce,
dataGrid.DataMe mber];
cm.EndCurrentEd it();
DataGridColumnS tyle curColumn =
dataGrid.TableS tyles[0].GridColumnStyl es[dataGrid.Curren tCell.ColumnNum ber];
dataGrid.EndEdi t(curColumn, dataGrid.Curren tRowIndex, false);
--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:5E******** *************** ***********@mic rosoft.com... Hi,
Suppose there is a DataGrid on a form bound to a DataTable. When a user is editing a cell without leaving the cell, and then closes the form, the value is not updated to the underlying data source.
How can I accomplish this?
Thanks, -- Tom Tempelaere.
It doesn't work. EndEdit *always* returns false, even if the entry is valid.
Unbelievable that even such trivial operations are so hard to find, and when
you try them they don't even work.
Duh,
Tom T.
"Dmytro Lapshyn [MVP]" wrote: CurrencyManager cm = (CurrencyManage r)this.BindingC ontext[dataGrid.DataSo urce, dataGrid.DataMe mber]; cm.EndCurrentEd it(); DataGridColumnS tyle curColumn = dataGrid.TableS tyles[0].GridColumnStyl es[dataGrid.Curren tCell.ColumnNum ber]; dataGrid.EndEdi t(curColumn, dataGrid.Curren tRowIndex, false);
-- Sincerely, Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_> wrote in message news:5E******** *************** ***********@mic rosoft.com... Hi,
Suppose there is a DataGrid on a form bound to a DataTable. When a user is editing a cell without leaving the cell, and then closes the form, the value is not updated to the underlying data source.
How can I accomplish this?
Thanks, -- Tom Tempelaere.
Try to swap the order - call EndEdit first and then EndCurrentEdit on the
CurrencyManager .
--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_>
wrote in message news:8D******** *************** ***********@mic rosoft.com... It doesn't work. EndEdit *always* returns false, even if the entry is valid.
Unbelievable that even such trivial operations are so hard to find, and when you try them they don't even work.
Duh, Tom T.
"Dmytro Lapshyn [MVP]" wrote:
CurrencyManager cm = (CurrencyManage r)this.BindingC ontext[dataGrid.DataSo urce, dataGrid.DataMe mber]; cm.EndCurrentEd it(); DataGridColumnS tyle curColumn = dataGrid.TableS tyles[0].GridColumnStyl es[dataGrid.Curren tCell.ColumnNum ber]; dataGrid.EndEdi t(curColumn, dataGrid.Curren tRowIndex, false);
-- Sincerely, Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_> wrote in message news:5E******** *************** ***********@mic rosoft.com... > Hi, > > Suppose there is a DataGrid on a form bound to a DataTable. When a user > is > editing a cell without leaving the cell, and then closes the form, the > value > is not updated to the underlying data source. > > How can I accomplish this? > > Thanks, > -- > Tom Tempelaere.
Dmytro,
Thanks for the suggestion. I'll try it out.
Thank you,
Tom T.
PS: Sorry for the frustrated tone ;-), DataGrid is rather complex sometimes.
"Dmytro Lapshyn [MVP]" <x-****@no-spam-please.hotpop.c om> schreef in bericht
news:%2******** ********@TK2MSF TNGP15.phx.gbl. .. Try to swap the order - call EndEdit first and then EndCurrentEdit on the CurrencyManager .
-- Sincerely, Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_> wrote in message news:8D******** *************** ***********@mic rosoft.com... It doesn't work. EndEdit *always* returns false, even if the entry is valid.
Unbelievable that even such trivial operations are so hard to find, and when you try them they don't even work.
Duh, Tom T.
"Dmytro Lapshyn [MVP]" wrote:
CurrencyManager cm = (CurrencyManage r)this.BindingC ontext[dataGrid.DataSo urce, dataGrid.DataMe mber]; cm.EndCurrentEd it(); DataGridColumnS tyle curColumn = dataGrid.TableS tyles[0].GridColumnStyl es[dataGrid.Curren tCell.ColumnNum ber]; dataGrid.EndEdi t(curColumn, dataGrid.Curren tRowIndex, false);
-- Sincerely, Dmytro Lapshyn [Visual Developer - Visual C# MVP]
"TT (Tom Tempelaere)" <_|\|_0$P@|/\|titi____AThot mailD.Tcom|/\|@P$0_|\|_> wrote in message news:5E******** *************** ***********@mic rosoft.com... > Hi, > > Suppose there is a DataGrid on a form bound to a DataTable. When a > user is > editing a cell without leaving the cell, and then closes the form, the > value > is not updated to the underlying data source. > > How can I accomplish this? > > Thanks, > -- > Tom Tempelaere.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Junkguy |
last post by:
I need some help programmatically causing a row in a DataGrid to "flush"
its contents to its bound data (in Visual Studio 6 using Windows Forms
with C#).
My issue is I want to send an update to a database from a menu command
while the user is editing a DataGrid. This is unusual in regard to
examples and normal practice in that the cell of the DataGrid still has
the focus. In all examples I can find, the user normally presses a
button on...
|
by: Chris Plowman |
last post by:
Hi all,
I was wondering if anyone can help me with a really annoying problem I have
been having. I made a derived datagrid class that will select the row when
a user clicks anywhere on a cell (multi-select without modifier keys). I
got that working fine, but I also wanted to keep rows selected after a sort,
which I do by storing the row's id in an arraylist. The idea was to do the
sort and then go back and re-select the rows with that...
|
by: Bill C. |
last post by:
Hello,
I know this has been discussed a lot already because I've been searching
around for information the last few weeks.
I'm trying to implement a DataGridComboBoxColumn class. I've found
several examples on the web. They all seem to have problems, though
that I've been unable to resolve.
The most promising example I have found is at:
|
by: PeterZ |
last post by:
G'day,
After doing much searching and pinching bits of ideas from here there and
everywhere I came up with a fairly 'clean' solution of including a comboBox
into a dataGrid column.
You can download a fully working C# sample with the Northwind.mdb here:
www.insightgis.com.au/web/stuff/DataGridCombo.zip
|
by: Islamegy |
last post by:
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
| |
by: Joe Au |
last post by:
I follow the Walkthrough documented on Visual Studio to create an editable
data grid but it does not work on getting the value of the textbox in the
data grid. The code is copied here. I mark "*****" at which the categoryName
always get the past value no matter what it has been changed. How do I fix
it? Thanks.
Joe.
Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As...
|
by: Suzanne |
last post by:
Hi all,
I'm having problems with datagrids and the currentcellchanged event.
My problem is this: I have a datagrid on a form, if the user changes
the text in a cell on the datagrid then tries to close the form via a
button on the toolbar (with going to another cell in the datagrid)I
want to be able to popup a messagebox to the user asking them if they
want to keep their changes.
At the momment I'm accomplishing this by a property that...
|
by: Scott Meddows |
last post by:
I have a datagrid control that I've inherited from the base datagrid control (Source below).
I am applying a datatable style onto the datatable that I assign as my datasource.
All of my column but one are set as readonly=true. The writeable column does not update when I'm editing it. Is there something
different that I need to be doing to update this data? Also, how do I get the "new row" to not appear at the bottom of the
datagrid?...
|
by: Earl |
last post by:
I want to fire a database update off of a single change to a single cell in
the datagrid. This apparently cannot be done using keypress, keyup, keydown,
etc. I've read George Shepard's FAQ and while I may have overlooked it, I
have not found an answer. I now am using the CurrentCellChanged event, and
this is satisfactory IF the user moves off of the cell before closing the
form. An obvious alternative would be to check for changes before...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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...
|
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 project—planning, coding, testing, and deployment—without 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...
|
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();...
|
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...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |