|
-
Mar 31st, 2005, 10:17 AM
#1
Thread Starter
Hyperactive Member
Data Grid selet row
Hello ...
when I click on the datagrid, a cell in the datagrid will be selected ...
but I want the whole row to be selected and not a cell ...
is there a style or something that should be changed ...
Muchas gracias ....
My software never has bugs. It just develops random features.
I RATE, YOU RATE!!!
-
Mar 31st, 2005, 10:43 AM
#2
Thread Starter
Hyperactive Member
Re: Data Grid selet row
any body has any idea about what I am talking about ??
I think its easy but I can't find it ...
My software never has bugs. It just develops random features.
I RATE, YOU RATE!!!
-
Mar 31st, 2005, 11:13 AM
#3
Hyperactive Member
Re: Data Grid selet row
There should be a Select method on the datagrid that you pass a rowindex to
-
Mar 31st, 2005, 11:18 AM
#4
Thread Starter
Hyperactive Member
Re: Data Grid selet row
do you have any sample code for that ???
Cause what I am talking about is selecting all the row ... Not a cell ... I dont want any cell to be selected ...
selecting a cell means selecting the whole row where the cell is...
My software never has bugs. It just develops random features.
I RATE, YOU RATE!!!
-
Mar 31st, 2005, 11:37 AM
#5
Hyperactive Member
Re: Data Grid selet row
VB Code:
myDataGrid.Select(0) 'Select Row 0 (first row)
msdn link:
ms-help://MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemwindowsformsdatagridclassselecttopic.htm
-
Mar 31st, 2005, 08:32 PM
#6
Re: Data Grid selet row
 Originally Posted by Mosabama
do you have any sample code for that ???
Cause what I am talking about is selecting all the row ... Not a cell ... I dont want any cell to be selected ...
selecting a cell means selecting the whole row where the cell is...
here's what i've got.
dunno if this would be the efficient one.
VB Code:
'cn is a connection
Dim da As New SqlDataAdapter("select * from orders", cn)
Dim dt As New DataTable()
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
da.Fill(dt)
DataGrid1.DataSource = dt
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
Dim s As String
For i = 0 To dt.Columns.Count - 1
s &= " " & DataGrid1.Item(DataGrid1.CurrentCell.RowNumber, i.ToString)
Next
MsgBox(s)
End Sub
hope that helps.
-
Apr 1st, 2005, 02:13 AM
#7
Re: Data Grid selet row
Is the RowHeader hidden? ie. so you have no selection tags on the left hand edge of the DataGrid.
Bruce.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|