Dynamically add columns to GridView?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How C#? I’ve tried everything and I hit brick wall. My VS 2005 doesn’t have a
DataGrid in the toolbox. I read that GridView replaced DataGrid, but another
programmer here also with VS 2005 has it under their general tab.

(Assume gridAttributes exsist)

gridAttributes.Columns.Add("b");

Intelisense says that the Add method expects DataControlField type. So I
changed:

DataControlField attributeType;
attributeType.HeaderText = "Local Type";
gridAttributes.Columns.Add(attributeType);

but if I build I can Use of un-assign variable attributeType

I’ve tried DataColumn which doesn’t work for GridView


Any assistance is appreciated
 
Back
Top