Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

Gridview - header

How can I loop through Gridview header, if find "*", hightlight the header to yellow?
ASKER CERTIFIED SOLUTION
Avatar of gamarrojgq
gamarrojgq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of VBdotnet2005

ASKER

I got an error : cells  >>> cannot be used like a method

Int16 intCells = default(Int16);
for (intCells = 0; intCells <= GridView1.HeaderRow.Cells.Count - 1; intCells++) {
      if (GridView1.HeaderRow.Cells(intCells).Text.IndexOf("*") > -1) {   <<<<<<<<<<<<<<<<<<<<<<<<<this line>>>>>>>>>>>>>
            GridView1.HeaderRow.Cells(intCells).BackColor = System.Drawing.Color.Yellow;
      }
}
My bad....syntex error   [] instead of () GridView1.HeaderRow.Cells

if (GridView1.HeaderRow.Cells[intCells].Text.IndexOf("*") > -1) {
Avatar of gamarrojgq
gamarrojgq

ok, sorry I think you were using vb instead of c#, but good to know that you figure it out !!!