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

How do I get datagrid's cell text ?

hi,

how would i get a datagrid's cell's text ?
i know the events that will tell me which cell i clicked on for
the row and column #'s, but cant find the properties to
get the text (i.e. "hello world" from row 1, column1). any know ?

thanks,
lee
Nov 20 '05 #1
4 1546
Lee,
Datagrids are designed to be bound to some table or two dimensional object.
If you know the row and column you then simply go to the corresponding row
and column in the bound source.

Regards
"Lee Holsenbeck" <Le***********@discussions.microsoft.com> wrote in message
news:B6**********************************@microsof t.com...
hi,

how would i get a datagrid's cell's text ?
i know the events that will tell me which cell i clicked on for
the row and column #'s, but cant find the properties to
get the text (i.e. "hello world" from row 1, column1). any know ?

thanks,
lee

Nov 20 '05 #2
I hope this helps

Try
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo

hti = Me.dgAssignedCalls.HitTest(e.X, e.Y)

If hti.Type <> DataGrid.HitTestType.None Then
Me.intRowNumber = hti.Row
Me.intCallNumber = Me.objDsAssignedCalls.Tables("tbl_CallDetails").Ro ws(intRowNumber)("CallNo")

Dim NewfrmWorkCall As New frmWorkCall
NewfrmWorkCall.dspCallNumber.Text = intCallNumber
NewfrmWorkCall.ShowDialog()
End If
Catch ex As Exception
End try
Nov 20 '05 #3
I hope this helps you,

Private Sub dgCriticalCalls_MouseDown(ByVal sender As Object, ByVal a As System.Windows.Forms.MouseEventArgs) Handles dgCriticalCalls.MouseDown
Try
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo

hti = Me.dgCriticalCalls.HitTest(a.X, a.Y)

If hti.Type <> DataGrid.HitTestType.None Then
Me.intRowNumber = hti.Row
Me.intCallNumber = Me.objDsCriticalCalls.Tables("tbl_CallDetails").Ro ws(intRowNumber)("CallNo")

Dim NewfrmAssignCall As New frmAssignCall
NewfrmAssignCall.dspCallNumber.Text = intCallNumber
NewfrmAssignCall.ShowDialog()
End If
Catch ex As Exception
Call ErrorMessage()
End Try
End Sub
Nov 20 '05 #4
I hope this helps you,

Private Sub dgCriticalCalls_MouseDown(ByVal sender As Object, ByVal a As System.Windows.Forms.MouseEventArgs) Handles dgCriticalCalls.MouseDown
Try
Dim hti As System.Windows.Forms.DataGrid.HitTestInfo

hti = Me.dgCriticalCalls.HitTest(a.X, a.Y)

If hti.Type <> DataGrid.HitTestType.None Then
Me.intRowNumber = hti.Row
Me.intCallNumber = Me.objDsCriticalCalls.Tables("tbl_CallDetails").Ro ws(intRowNumber)("CallNo")

Dim NewfrmAssignCall As New frmAssignCall
NewfrmAssignCall.dspCallNumber.Text = intCallNumber
NewfrmAssignCall.ShowDialog()
End If
Catch ex As Exception
Call ErrorMessage()
End Try
End Sub
Nov 20 '05 #5

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

Similar topics

3
by: PeterZ | last post by:
G'day, After doing much searching and pinching bits of ideas from here there and everywhere I came up with a fairly 'clean' solution of including a comboBox into a dataGrid column. You can...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
2
by: itgMan | last post by:
hello friends, i have a question about datagrid, i have binded a datagrid with a datatable from values that came from a comma seperated values (.CSV) file i have created textboxes in all...
4
by: Luis Esteban Valencia | last post by:
I have a asp.net page (C#), with a datagrid. I use template for all columns, and have <asp:requiredfieldvalidator> in with one of the textboxes, to make sure it's filled in. However, this...
1
by: strout | last post by:
I know it's dumb ... sometimes frustrating I want the text and a dropdownlist align with both side of a table cell, i.e. text align left and dropdownlist align right. I cannot add more cells to...
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
4
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...
2
by: Peter | last post by:
ASP.NET 2003 In the DataGrid how do I select current cell value in the dropdown box when I click on the edit link, currently when I click on the edit link in the DataGrid the dropdown box...
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...
1
by: Tarik Monem | last post by:
Hi everyone and I hope that you can help. I am trying to send a value of a cell within a Datagrid to my php file which has a simple sql query: here's the php: <? $server = "localhost";
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
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.