How to add GridViewColumnHeader to GridViewColumn dynamically?

1.1k views Asked by At

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?

1

There are 1 answers

0
kiwipom On

You can simply set the Header property, like

idColumn.Header = idColumnHeader;