Hello, I have a grid that is created in runtime. The header of my grid is empty after a postback.
private void BindGrid(RadGrid _radgrid ,string[] campos)
{
List<string> parametrosCamposRetornados = new BRPesquisa().RecuperaCamposRetornados(Pesquisa.IdConsulta, Pesquisa.NumeroPesquisa);
foreach (string x in campos)
{
if (x != "")
{
if (parametrosCamposRetornados.Contains(x.ToUpper()) || parametrosCamposCDRRetornados.Count ==0)
{
GridBoundColumn gridBoundColumn = new GridBoundColumn();
gridBoundColumn.UniqueName = x;
gridBoundColumn.DataField = x;
gridBoundColumn.HeaderText = x;
_radgrid.Columns.Add(gridBoundColumn);
}
}
}
}
after that I create the columns I get the data to the grid and do the databinding
rdgResultado.DataSource = dtResultado;
rdgResultado.DataBind();
My grid works correctly, but when I do a postback in my web page, the header of my Grid is empty.
How I can resolve this problem?