My Question is:
I have a GridView and it contains a column (Button field). Now I want to know on runtime that wheather my Grid contains a Button field or not.
foreach (DataColumn col in Table.Columns)
{
ButtonField btnfield = new ButtonField();
btnfield.ButtonType = ButtonType.Image;
if (grid.Columns.Contains(btnfield))
{
grid.Columns.RemoveAt(grid.Columns.IndexOf(btnfield));
}
}
This code does not work. I want to achieve this task without Row Data Bound.
Regards Zuhaib