473,757 Members | 8,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGridView, getting the dirty value of a cell when editing

Hi guys,

I have a problem with the DataGridView. I want to catch the value of a cell
when the user is editing it. Actually, I can't figure if there is an event
or a property to get this value.

For example, when the user type something on a cell, I want to display what
he wrote on another place in my application. I don't care if this text isn't
going to be used finally (a.k.a, if the user cancel the editing mode).

Is there a way to do that? I really can't figure any.

Thanks!
Oct 31 '06 #1
2 4765
Oops, sorry for the silly name i used. Misconfiguratio n of this newsreader.

"news.microsoft .com" <tynril[no@spam]gmail.comwrote in:
Oz************* *@TK2MSFTNGP03. phx.gbl...
Hi guys,

I have a problem with the DataGridView. I want to catch the value of a
cell when the user is editing it. Actually, I can't figure if there is an
event or a property to get this value.

For example, when the user type something on a cell, I want to display
what he wrote on another place in my application. I don't care if this
text isn't going to be used finally (a.k.a, if the user cancel the editing
mode).

Is there a way to do that? I really can't figure any.

Thanks!

Oct 31 '06 #2
On 2006-10-31, news.microsoft. com <tynrilwrote:
Hi guys,

I have a problem with the DataGridView. I want to catch the value of a cell
when the user is editing it. Actually, I can't figure if there is an event
or a property to get this value.

For example, when the user type something on a cell, I want to display what
he wrote on another place in my application. I don't care if this text isn't
going to be used finally (a.k.a, if the user cancel the editing mode).

Is there a way to do that? I really can't figure any.
Uses the DGV EditingControlS howing event to get at the control..
Here is an example for a DataGridViewTex tBoxColumn...

private void dataGridView1_E ditingControlSh owing(object sender, DataGridViewEdi tingControlShow ingEventArgs e)
{
TextBox textBox = e.Control as TextBox;
textBox.Text = "hihi";
}

--
Met vriendelijke groeten,
Tim Van Wassenhove <http://www.timvw.be>
Oct 31 '06 #3

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

Similar topics

8
34300
by: George | last post by:
Hi, I have been trying to see if I can do the following: 1. Create a DataGridView 2. Create 2 columns in the DataGridView (1 textbox and the other combobox) 3. Create a DataTable containing my data. (AutoGenerateColumns is true). The data is 2 columns of System.String cell. 4. If I assign the DataTable to DataGridView.DataSource, I get 4 columns. 2
5
21452
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net help system and can't find any help on formatting text. There's plenty of help formatting numbers, dates, and times, though. I'm in the phase of converting from 6 to Net and it seems that even the simplest thing is very, very complicated. And it...
3
4654
by: Daniel Manes | last post by:
I need a strategy to debug this situation... I can't put all the code involved, but here are some of the critical lines with comments: ------------------------- Private _parentDataCell As DataGridViewCell 'declare private field _parentDataCell = _parentDataGrid.Rows(rowIndex).Cells(columnIndex) 'set to a specific cell Debug.Print(_parentDataCell.DataGridView.ToString) 'prints:
5
7153
by: DanThMan | last post by:
The situation: * I have a ButtonColumn in a DataGridView. * When the user preses one of the buttons, a dialog appears. * Based on what the user selects in the dialog, data is entered programmatically into the the underlying cell (i.e., I'm setting Value property of the cell based on user input, but the user is not directly entering any data). The problem:
0
2179
by: RKT | last post by:
I have a DataGridView bound to an MS Access table. This is a single- user application. When the User is adding or editing a row, the User may click on a Control elsewhere. That Control has context which I use to programmatically set *other* r/o cell values for the currently selected grid row. So, after that click on another control, and stuffing the related cell values, I want to seamlessly allow the user to resume editing/adding that row...
1
10233
by: Roach | last post by:
VB.NET 2005 2.0 Framework application is using a DataGridView for SQL data access and user data entry. As part of exception/error handling, the app wants to advise the user when he/she enters a value into a DGV field that is inappropriate; for example, an alpha character in a cell containing an integer value. When the user types in the alpha and hits enter, BeginEdit fires off, realizes the cell is dirty, and can see the previous/old...
0
2724
by: systeko | last post by:
Hello, I have one little problem which make me crazy. I've made application (for Windows) in Visual C#. On one panel I've got datagridview control which is not bind to database, I populate it manualy. It has 4 columns and only one can be edited and user can put some numbers in it (It is float type). I want to validate ie. to check if that value is in some boundaries (min and max value is in 2. and 3. column and column for editing is 1.). If...
1
15001
by: JB | last post by:
Hi All, I'd like to display password characters in a DataGridView column, the same way I can do in a standard TextBox by using the PasswordChar property (i.e.typed characters replaced by a star for instance). Can anyone tell me how? Thanks JB
0
5656
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be blank unless they are filled by the user. 2) As soon as the user enters a cell, the dtp control should appear as the editing control of that cell. If there's a value in the cell beforehand, that value is set as the value of the dtp editing control...
0
9298
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
10072
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...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9737
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
8737
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 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...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
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();...
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.