|
-
June 4th, 2002, 04:01 AM
#1
DataGrid, row select
Hi, I have a datagrid on my form and I want to be able to click on a row in that datagrid so the whole row is selected, not just one cell.
I allso want to retrieve the value of the first column in the selected row.
Anyone know how to do this or where to find good info on DataGrid? I think I have read just about everything in the help in visual studio...
-
June 4th, 2002, 08:22 AM
#2
Re: DataGrid, row select
Hey Mundi,
I do it this way:
int Row = dataGridGebruikers.CurrentRowIndex;
DataGridCell myCell = new DataGridCell();
// Use and arbitrary cell.
myCell.RowNumber = Row;
myCell.ColumnNumber = 0;
string selectedUserID = dataGridGebruikers[myCell].ToString().Trim() ;
dataGridGebruikers.Select(Row);
The selectedUserID I use to construct my SQL command for future use.
Consernating the good info on DataGrid, it's all in the help file and in MSDN just you have to know what you're looking after, there is noting like a course on it. Many information I have found in "ADO.NET Step by Step" by "Rebecca Riordan" an edition of Microsoft press
Geetings
Jean Paul
Originally posted by Mundi
Hi, I have a datagrid on my form and I want to be able to click on a row in that datagrid so the whole row is selected, not just one cell.
I allso want to retrieve the value of the first column in the selected row.
Anyone know how to do this or where to find good info on DataGrid? I think I have read just about everything in the help in visual studio...
-
June 4th, 2002, 08:30 AM
#3
thanx, that´s what I needed...
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
|