this example displays value of each cells in datagrid
keep column no constant and iterate through rows
private void PrintCellValues(DataGrid myGrid){
int iRow;
int iCol;
DataTable myTable;
// Assumes the DataGrid is bound to a DataTable.
myTable = (DataTable) dataGrid1.DataSource;
for(iRow = 0;iRow < myTable.Rows.Count ;iRow++) {
for(iCol = 0;iCol < myTable.Columns.Count ;iCol++) {
Console.WriteLine(myGrid[iRow, iCol]);
}
}
}
i hope you get idea.
feel free to mail me at
ma***************@yahoo.com
--
Have A Good Day,
Mahesh,
Ma************@yahoo.co.in
"Sivana" wrote:
I understand the logic, I'm lacking some sample code. I'm not sure which
objects I need to look at.
A brief code sample of "looping through an entire table and look for
cell/column value" would be much helpful.
-R
"MAHESH MANDHARE" wrote:
hi Sivana,
loop through entire table and get the rowindex of row which has that column
and then use Datagrid1.select(rowindex).
--
Have A Good Day,
Mahesh,
Ma************@yahoo.co.in
"Sivana" wrote:
I need to loop through the column cell values and look for a string then
highlight the row.
"veera sekhar kota" wrote:
> 1. Get an selected row index
> 2. use DataGrid1.Select(rowIndex)
>
> hope U can understand....
>
> "Sivana" wrote:
>
> > Hello,
> >
> > Does anyone have sample code where I can highlight an entire row based on a
> > column or cell value?
> >
> > Thanks,
> >
> > -- Rich