This is a migrated thread and some comments may be shown as answers.

the header of my grid is empty after a postback

1 Answer 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
marcos pereira
Top achievements
Rank 1
marcos pereira asked on 23 Jul 2010, 03:31 AM

 

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?



1 Answer, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 26 Jul 2010, 02:41 PM
Hi Marcos

Make sure that you are using Advanced databinding as opposed to Simple databinding for populating the RadGrid control.

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
marcos pereira
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Share this question
or