H
Harry Keck
According to the example given in the MSDN documentation, I can call
GridView.Columns.Add during the postback phase of a page. This seems to work
properly. However, if I call GridView.Columns.Insert during the postback
phase, the grid does not render properly, particulary, nothing displays in my
TemplateField columns.
It seems that the only time I can use GridView.Columns.Insert is during the
Init phase of the page lifecycle, but that means that I do not have access to
ViewState or any other ui controls in order to determine what columns I want
to dynamically add. Is this behavior as designed by Microsoft? It would
seem from the GridView.Columns.Add documentation that this type of
manipulation should be available from postback, but clearly it is not, and it
is really putting a hamper on how dynamic my grid columns can really be.
Has anyone found a good workaround for this? Particulary, I want to be able
to use GridView.Columns.Insert during a phase of a page's lifecycle where I
have access to the other UI controls, so that I can alter columns based on
user input.
GridView.Columns.Add during the postback phase of a page. This seems to work
properly. However, if I call GridView.Columns.Insert during the postback
phase, the grid does not render properly, particulary, nothing displays in my
TemplateField columns.
It seems that the only time I can use GridView.Columns.Insert is during the
Init phase of the page lifecycle, but that means that I do not have access to
ViewState or any other ui controls in order to determine what columns I want
to dynamically add. Is this behavior as designed by Microsoft? It would
seem from the GridView.Columns.Add documentation that this type of
manipulation should be available from postback, but clearly it is not, and it
is really putting a hamper on how dynamic my grid columns can really be.
Has anyone found a good workaround for this? Particulary, I want to be able
to use GridView.Columns.Insert during a phase of a page's lifecycle where I
have access to the other UI controls, so that I can alter columns based on
user input.