Getting the column from a table cell

Z

zahidayar

Hello everyone,

Is it possible (and if so, how) to obtain a reference to the column
given a table cell for a datagrid?

Zahid
 
E

Elton Wang

What do you mean column, column of datagrid? And how do get the tablecell of
the datagrid?
 
Z

zahidayar

foreach (DataGridItem dgi in DataGrid1.Items)
{
// this code gives you the rows of the DataGrid
foreach (Control c in dgi.Controls)
TableCell tc = (TableCell)c;
// the code above gets you the cells of the row
....
}

so we can get any row of the datagrid by using the code
"DataGrid1.Items"
where 'i' is the row index...is there similarly a quick way to get a
column? or once you have a cell, is it possible to get its parent row
or column...?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top