Question

I am new on devexpress,so I have a simple question here.what is the equal of the this code on devexpres gridview.

here is the my code

for (int i = 0; i <gridView1.RowCount; i++)
{
    string Name = gridView1.Rows[i].["ColumName"].toString();                                  
}

I looked at the a method something gridView1.Rows[i] but ,not available.

Was it helpful?

Solution

Take a look at the documentation for Traversing Rows in the DevExpress support center. Looks like this would work:

for (int i = 0; i < gridView1.VisibleRowCount; i++)
{
    DataRow row = gridView1.GetDataRow(i);
    string name = row["ColumnName"].ToString();
}

OTHER TIPS

You can loop through like this

for (int i = 0; i < gridView1.VisibleRowCount; i++)
{
int currentRowHandle = gridView1.GetVisibleRowHandle(i);
string value = grid.GetCellValue(rowHandle,grid.Columns["Column Name"]);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top