-
August 5th, 2003, 02:29 PM
#1
getting column value from DataGrid
I have a data grid named
dgMedical. I need to get the value of the 2nd column
to display in my code. Any help.
is it like
dgMedical.select(1); ?
thanks
-
August 6th, 2003, 12:47 AM
#2
Hi,
U can use
DataGrid1.Items[selectedItem].Cells[1].Text to get the text of a particular cell in the selected row.
regards,
Ashish Sheth
-
August 6th, 2003, 12:54 AM
#3
hi,
another thing you can use is this:
string str = dataGrid1[int rowIndex, int columnIndex].ToString();
or a like i did few days ago:
if you use a mouseklick to select you can do this:
add the
"CurrentCellChanged(object sender,System.EventArgs e)"
message and in the body of it you only need
"string str = dataGrid1[dataGrid1.CurrentCell].ToString().Trim();"
blue skies
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
|