473,796 Members | 2,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

getting the value in a datagrid cell

I have a datagrid, populated via a SQL dataset, and I want the user to select
a row by clicking on it and then using the value in the first cell as my key
for my next query. Using CurrentCellChan ged works unless I want the row which
has a cell selected and I click on that cell, obvious answer click another
cell in that row, but I have to code for stupid users!
I tried the click event but that didn't work, maybe I was doing something
wrong.
Can I open the datagrid with no cell selected?

TIA
Jul 21 '05 #1
2 1988
Graham,

Following the information on this site you should be able to find your
answer
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

Did you know that there are special programlanguage newsgroups
microsoft.publi c.dotnet.langua ges.vb and csharp and vc

I hope this helps?

Cor

"Graham Y" <Gr*****@discus sions.microsoft .com>
I have a datagrid, populated via a SQL dataset, and I want the user to
select
a row by clicking on it and then using the value in the first cell as my
key
for my next query. Using CurrentCellChan ged works unless I want the row
which
has a cell selected and I click on that cell, obvious answer click another
cell in that row, but I have to code for stupid users!
I tried the click event but that didn't work, maybe I was doing something
wrong.
Can I open the datagrid with no cell selected?

TIA

Jul 21 '05 #2
Thanks
I was looking for that, I used to use/support the Excel programing newsgroup.
GY

"Cor Ligthert" wrote:
Graham,

Following the information on this site you should be able to find your
answer
http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp

Did you know that there are special programlanguage newsgroups
microsoft.publi c.dotnet.langua ges.vb and csharp and vc

I hope this helps?

Cor

"Graham Y" <Gr*****@discus sions.microsoft .com>
I have a datagrid, populated via a SQL dataset, and I want the user to
select
a row by clicking on it and then using the value in the first cell as my
key
for my next query. Using CurrentCellChan ged works unless I want the row
which
has a cell selected and I click on that cell, obvious answer click another
cell in that row, but I have to code for stupid users!
I tried the click event but that didn't work, maybe I was doing something
wrong.
Can I open the datagrid with no cell selected?

TIA


Jul 21 '05 #3

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

Similar topics

3
1982
by: Dav | last post by:
I have a Winform with a derived datagrid and a button that adds a row to the datagrid in its Click event. The button has a shortcut text "&New Row". When I enter a value in a datagrid cell and then mouse click the button without tabbing out of the edited cell, everything is fine. If I hit Alt+N instead after editing the cell, the cell values are reset to the previous value of the cell before the button_click code is executed. I have...
1
1846
by: Blake Versiga | last post by:
When editing a datagrid (C#) I need to know if the user changed the value of cell AND what the previous value was. Is this possible? If so how do I get the previous value or at least if the cell has changed? TIA Blake
5
1822
by: Jason | last post by:
I've been trying to figure out a good way to do this but haven't had much luck, any input would be greatly appreciated. Basically, after a datagrid is sorted, how can I get the primary key value of the item selected by the user? That is, not the datagrid index 'location' of the item the user selected, but the value inside a column of this item the user clicked on. I would use the CurrencyManager in a windows application but I'm not...
2
1606
by: niceguy | last post by:
Hi I was wondering if its possible to get the exact displayed text from a cell in a datagrid. I need to get the displayed text and not any 'real' database value or anything that the cell might contain in the background. I've tried getting to get the text through the datagrid's control
4
908
by: gugu | last post by:
Hi I have a datagrid which has 20 rows and 20 columns, 15 of 20 columns are checkboxs and their headertexts, datafields are dynamic. I need to loop through the whole page to see if the specific check box cell is checked or not. The code is as follows: For rowindex = 0 To myDataGrid.Items.Count - 1 Dim item As DataGridItem = myDataGrid.Items.Item(rowindex) For colindex = 0 To myDataGrid.Columns.Count - 1
2
318
by: Graham Y | last post by:
I have a datagrid, populated via a SQL dataset, and I want the user to select a row by clicking on it and then using the value in the first cell as my key for my next query. Using CurrentCellChanged works unless I want the row which has a cell selected and I click on that cell, obvious answer click another cell in that row, but I have to code for stupid users! I tried the click event but that didn't work, maybe I was doing something wrong....
3
2130
by: Jeff | last post by:
Help.. I have been using: string sId = ((System.Web.UI.WebControls.TextBox)e.Item.Cells.Controls).Text; To get the value of a cell in my datagrid. When I set the cell to read only, I get an error message. I need to retrieve this value so I can use it in my query to update the
0
1936
by: Matt | last post by:
I derived my own custom class from the datagrid class. I overrode the ProcessCmdKey Function, like this, to catch the up and down arrow keys: ====== Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean Const WM_KEYDOWN As Integer = &H100
3
2285
by: Greg | last post by:
My problem is that values in the bool column of a datagrid are only being updated to the database once the focus of the bool cell is lost. This is completely counter-intuitative. When a user clicks on a bool type cell in a datagrid and sees a check mark put in / removed, then he/she would expect this to be reflected in the databsae immediately. I've even overriden the paint, commit and edit methods of the bool column class (which...
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9533
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
10461
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
10190
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
6796
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
5447
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...
1
4122
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
2
3736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2928
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.