Hello!
I have a grid with a GridTemplateColumn created dynamically on Page_Init.
And in ItemCreated:
The column display correctly, but when I use the Pager to move around the other pages the Init is not fired, only the ItemCreated and a error is throw because the panel pnlQuest doesn´t exists.
How I put the column in the grid viewstate to don´t have to create everytime?
Thanks!
I have a grid with a GridTemplateColumn created dynamically on Page_Init.
Dim gtc As New GridTemplateColumnWith gtc .UniqueName = "gtcQuest" .HeaderTemplate = New clsGridViewTemplate(GridItemType.Header, "Quest", "Quest.", "") .FilterTemplate = New clsGridViewTemplate(GridItemType.EditItem, "", "", "") .ItemTemplate = New clsGridViewTemplate(GridItemType.Item, "pnlQuest", "", "") .HeaderStyle.Width = Unit.Pixel(60) .HeaderStyle.HorizontalAlign = HorizontalAlign.CenterEnd WithradGrid.MasterTableView.Columns.AddAt(0, gtc)And in ItemCreated:
Dim btnQuest As New ButtonbtnQuest.ID = "btnQuest"DirectCast(e.Item.FindControl("pnlQuest"), Panel).Controls.Add(btnQuest)The column display correctly, but when I use the Pager to move around the other pages the Init is not fired, only the ItemCreated and a error is throw because the panel pnlQuest doesn´t exists.
How I put the column in the grid viewstate to don´t have to create everytime?
Thanks!