473,394 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

current row key in data grid

is there a simple way to get the currently selected row's key in a bound
data grid in winforms? thanks
Nov 21 '05 #1
2 1181
Brian,
Is this what you want?
Dim intMyRow As Integer

Dim cellItm As DataGridCell

Dim MyKey As Integer

cellItm = MyGrid.CurrentCell

intRow = cellItm.RowNumber

MyKey = MyGrid(intRow, 1).ToString

Doug

"Brian Henry" <sd**@sdf.net> wrote in message
news:OM*************@TK2MSFTNGP14.phx.gbl...
is there a simple way to get the currently selected row's key in a bound
data grid in winforms? thanks

Nov 21 '05 #2
thanks!

"Doug Bell" <dug@bigpond> wrote in message
news:eG**************@TK2MSFTNGP12.phx.gbl...
Brian,
Is this what you want?
Dim intMyRow As Integer

Dim cellItm As DataGridCell

Dim MyKey As Integer

cellItm = MyGrid.CurrentCell

intRow = cellItm.RowNumber

MyKey = MyGrid(intRow, 1).ToString

Doug

"Brian Henry" <sd**@sdf.net> wrote in message
news:OM*************@TK2MSFTNGP14.phx.gbl...
is there a simple way to get the currently selected row's key in a bound
data grid in winforms? thanks


Nov 21 '05 #3

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

Similar topics

0
by: Jawahar Rajan | last post by:
All, I have a datagrid that I use in a ASP.net web page that loads customer data based on the selected customer ID Some Customers will have no data in the database (which is oracle 9.2) . So I...
2
by: Red Green | last post by:
I have a form with a datagrid and a dataset bound to it. I want to launch a second form and pass it a value from whichever record the user has selected. I can't find an example anywhere that shows...
6
by: Chad Z. Hower aka Kudzu | last post by:
Well hopefully this will help some others now.. http://www.codeproject.com/useritems/DBGridCurrentRow.asp -- Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/ "Programming is an art...
1
by: Greg | last post by:
I have a data entry form with a grid. When the user changes data in a column, and then clicks the Red X of the form to close it, I trap this in the Closing event. I first call the...
7
by: Brian Henry | last post by:
Hi, I have a data grid that has the following properties EnableViewState = false AllowPaging = true AllowSorting = true AllowCustomPaging = false now, when the page switches I want to get...
2
by: Brian Henry | last post by:
Hi, I have a data grid that is set up like this Page items displayed = 10 EnableViewState = false (i dont want to send large amounts of data over the internet!) CustomPaging = false...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
1
by: Larry Lard | last post by:
I've got a Windows Forms app talking to an Access db, and I'm experimenting with VS2005's form data binding stuff etc. I've got a dataset, a datagridview bound to a query (let's call it...
4
by: Keith G | last post by:
VS2003 I am using a datagrid on a Windows form. The user has 2 buttons: cancel the current changes (re-loads the dataset) or update (updates the dataset). The problem is that any edits in the...
8
bplacker
by: bplacker | last post by:
I have a datagridview which is filled with data from a table in a database. In the grid, the user clicks a row to edit that specific record. An edit screen is brought up, which has a text box for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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,...
0
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...
0
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...

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.