Controls in Datagrid column

  • Thread starter Thread starter krallabandi
  • Start date Start date
K

krallabandi

Hi

How to change any control properties in a datagrid column.

Basically, I want to check all controls in a datagrid column, if the
particular control is label, I need to chage the properties of that
label control.

Is that possible? Pls help me to provide a codesnippet.

Eg:

for(int i = 0; i < 12; i++)
{
this.pagesGrid.Columns.ItemStyle.CssClass = "pagegridselect";
/*Need to check for lable control & change the properties of label
control*/
}


Regards.
 
Hi,

Yes, I think it's possible, do this:
1- handle the PreRender event
2- iterate in the datagrid rows , Please note that the grid data is kept in
rows, no in columns as you assume in your code below
3- check the Controls of the cell using DataGridItem.Cells[
columnnumber].Controls
4- check for your label
5- update the property value.


Cheers,
 
Back
Top