473,396 Members | 2,129 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,396 software developers and data experts.

Retreiving DataGrid Values in VB.Net

Good Morning,

I have a gatagrid that the user can only select the
entire row in. My question is once the user has select
the row how do I get the value of the first column in
that selected row.

Thanks in advance!

Dale
Nov 20 '05 #1
3 9300
Dale,

Dim Col as Integer = 2 'Arbitary column number
MsgBox(dg1.Item(dg1.CurrentRowIndex, Col ))

Regards - OHM#
Dale wrote:
Good Morning,

I have a gatagrid that the user can only select the
entire row in. My question is once the user has select
the row how do I get the value of the first column in
that selected row.

Thanks in advance!

Dale


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #2
Try the DataGrid.HitTest Method - see the following MSDN link for
description and examples. I use it and love it.
http://msdn.microsoft.com/library/de...ttesttopic.asp

Cheers

Ron...

"Dale" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
Good Morning,

I have a gatagrid that the user can only select the
entire row in. My question is once the user has select
the row how do I get the value of the first column in
that selected row.

Thanks in advance!

Dale

Nov 20 '05 #3
Useful method. However, the OP wanted to discover how to get a colum in a
current row. Like my post above, hit test will give you the X,Y where you
clicked not a particular column value in that row.

Regards - OHM

Ron Courteau wrote:
Try the DataGrid.HitTest Method - see the following MSDN link for
description and examples. I use it and love it.
http://msdn.microsoft.com/library/de...ttesttopic.asp
Cheers

Ron...

"Dale" <an*******@discussions.microsoft.com> wrote in message
news:06****************************@phx.gbl...
Good Morning,

I have a gatagrid that the user can only select the
entire row in. My question is once the user has select
the row how do I get the value of the first column in
that selected row.

Thanks in advance!

Dale


Regards - OHM# On**********@BTInternet.com
Nov 20 '05 #4

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

Similar topics

0
by: pathisunil | last post by:
Dear All I have an xmldocument which is as formed below. It is a bit of loopy in nature. can anyone kindly let me know how can i write a xslt which would take a parameter which is an attribute...
0
by: Gamze | last post by:
Hi, How can i get values from datagrid to combobox and should select the same name as in datagrid row on the combobox control In my vb.net windows application ,i have combobox which is...
7
by: TT (Tom Tempelaere) | last post by:
Hi there, I'm struggling to get the right event. I want to be notified of a change in a cell in a DataGrid made by a user. I need following information about the change: * the row index * the...
2
by: Reddy | last post by:
Hi, Once after inserting a record into a table is there a more efficient way of retreiving the id(autonumber field) value in the following example. Using a SQL server database. con.Open() ...
4
by: Vik | last post by:
How can I display the lookup values in a datagrid? E.g., the datagrid displays a table that contains a ProductID field. I want to display a Product description from a Product table in that...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
0
by: cindy | last post by:
I have a dynamic datagrid. I have custom classes for the controls public class CreateEditItemTemplateDDL : ITemplate { DataTable dtBind; string strddlName; string strSelectedID; string...
9
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the...
0
by: yogeeswar | last post by:
HI ALL I AM USING DB2 8.1 AND I HAVE TWO TABLES PARENT TABLE 1)CODE IS PRIMARY KEY CODE CODE_DESC CATEGORY ----------- ----------------------------------------...
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: 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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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
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,...
0
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...

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.