jolly
jolly

Reputation: 137

How to add GridViewColumnHeader to GridViewColumn dynamically?

Hi I am creating GridView column dynamically like this:

GridViewColumn idColumn = new GridViewColumn();
grdMain.Columns.Add(idColumn).

Now I want to attach ColumHeader to create the column dynamically. I did:

GridViewColumnHeader idColumnHeader = new GridViewColumnHeader();

Now how can I attach this Header to idColumn?

Upvotes: 0

Views: 1119

Answers (1)

kiwipom
kiwipom

Reputation: 7709

You can simply set the Header property, like

idColumn.Header = idColumnHeader;

Upvotes: 2

Related Questions