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 ....
Printable View
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 ....
any body has any idea about what I am talking about ??
I think its easy but I can't find it ...
There should be a Select method on the datagrid that you pass a rowindex to
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...
VB Code:
myDataGrid.Select(0) 'Select Row 0 (first row)
msdn link:
ms-help://MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemwindowsformsdatagridclassselecttopic.htm
here's what i've got.Quote:
Originally Posted by Mosabama
dunno if this would be the efficient one.
hope that helps. :rolleyes: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
Is the RowHeader hidden? ie. so you have no selection tags on the left hand edge of the DataGrid.
Bruce.