473,563 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid CurrentCellChan ged

Hello all,

I'm trying to find a way to get a event raised when you change some text on
a DataGrid Cell, I need to be able to search in another table what the user
typed on that cell.

I found this, but this only give me the row and the cell I change position
to.

[C#]
// Create an instance of the 'CurrentCellCha nged' EventHandler.
private void CallCurrentCell Changed()
{
myDataGrid.Curr entCellChanged += new EventHandler(Gr id_CurCellChang e);
}

// Raise the event when focus on DataGrid cell changes.
protected void Grid_CurCellCha nge(object sender, EventArgs e)
{
// String variable used to show message.
string myString = "CurrentCellCha nged event raised, cell focus is at ";
// Get the co-ordinates of the focussed cell.
string myPoint = myDataGrid.Curr entCell.ColumnN umber + "," +
myDataGrid.Curr entCell.RowNumb er;
// Create the alert message.
myString = myString + "(" + myPoint + ")";
// Show Co-ordinates when CurrentCellChan ged event is raised.
MessageBox.Show (myString, "Current cell co-ordinates");
}
Anyone know?

Thanks
Nov 15 '05 #1
1 12199
The Validating event might work for you. It gets fired
before the cell is actually exited. It has the added
advantage that you can cancel out and display an error
message if you don't find what you are looking for.
-----Original Message-----
Hello all,

I'm trying to find a way to get a event raised when you change some text ona DataGrid Cell, I need to be able to search in another table what the usertyped on that cell.

I found this, but this only give me the row and the cell I change positionto.

[C#]
// Create an instance of the 'CurrentCellCha nged' EventHandler.private void CallCurrentCell Changed()
{
myDataGrid.Curr entCellChanged += new EventHandler (Grid_CurCellCh ange);}

// Raise the event when focus on DataGrid cell changes.
protected void Grid_CurCellCha nge(object sender, EventArgs e){
// String variable used to show message.
string myString = "CurrentCellCha nged event raised, cell focus is at "; // Get the co-ordinates of the focussed cell.
string myPoint = myDataGrid.Curr entCell.ColumnN umber + "," + myDataGrid.Curr entCell.RowNumb er;
// Create the alert message.
myString = myString + "(" + myPoint + ")";
// Show Co-ordinates when CurrentCellChan ged event is raised. MessageBox.Show (myString, "Current cell co-ordinates");
}
Anyone know?

Thanks
.

Nov 15 '05 #2

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

Similar topics

8
7831
by: amber | last post by:
Hello, How can I trigger an event, when a value (cell) in my datagrid changes? TIA, amber
2
1858
by: PAUL GROSSMAN | last post by:
Hello everyone. I am working with a DataGrid using VB .Net (Windows Forms). I want to make one of the columns un-editable. I was able to do that by setting the .dsName.Tables("TblName").Columns("ColName").ReadOnly = True That made it so you can't change the value in the column, but you're still tabbing into the column (despite the...
3
2802
by: Maqsood Ahmed | last post by:
Hello, Here is the scenario: I have a datagrid on a winform and a datatable is set as its datasource. I have added DataGridTableStyle in datagrid's TableStyles property. Some of Gridstyles are numeric (doubles) and I have set their format to #,0.0000 since I want to display the values to comma seperated (at thousands) and till four decimal...
4
7360
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...
3
2150
by: Arsalan | last post by:
How do I validate inputs in DataGrid ? I want to check for constraint and change columns value dynamically, for e.g i've column named employee, annual salary and salary I want the columns annual salary to be dynamically changed when user changes salary in datagrid How do I do it?
5
1580
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...
9
394
by: BK | last post by:
In VB.Net (1.1 framework), I have a datagrid that displays records from a SQL table. Only some of the columns are editable. When the user changes data in 2 and only 2 of the columns, I want to perform some calculations. There are about a dozen fields, only 3 of them are editable and I only want to perform the calculations when the user has...
6
2232
by: Doug Bell | last post by:
Hi I have a DataGrid with some hidden columns and also some read Only and some ComboBox Columns. Sandard Tabbing through the Datagrid sees the focus go to the hidden columns requiring further Tabbing to get to the desired column but it works fine stopping correctly on the ComboBox column. I have built a routine to test whether the use is...
5
1999
by: cj | last post by:
This should be easy. I have a datagrid filled with data and when I click on a cell I want that data displayed in a text box. How do I do this? Thanks. P.S. this is a 2005 windows app.
0
7664
marktang
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...
0
8106
jinu1996
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...
1
7638
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...
0
7948
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...
0
6250
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...
1
5484
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...
0
3642
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...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1198
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.