RGVBBoxRecords.Columns[idx].HeaderText = headerstr[idx];
or
RGVBBoxRecords.Columns[idx].Header = headerstr[idx];
but nothing changes.
How to do it?
6 Answers, 1 is accepted
My code uses a dictionary as resource and dynamicresource to bind to it.
<Controls:RadGridView.Columns>
<Controls:GridViewDataColumn HeaderText="{DynamicResource WindowMain_RadGridViewCustomers_CompanyName}" UniqueName="CompanyName" />
</Controls:RadGridView.Columns>
Any solutions to this problem or do i need to reinstall the previous version where the problem doesn't exist?
Hello,
@ Allan:
With our Q2 2009 we introduced new column property Header (of type object) similar to MS DataGrid and now HeaderText is obsoleted.
@Stefano Zambonin:
You may try to subscribe to the DataLoaded event of the RadGridView and perform updates to the desired column header like this:
void gridview_DataLoaded(object sender, EventArgs e)
{
this.RadGridView1.Columns[0].Header = "Test1";
}
Hope this helps.
Best wishes,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
void RGVBBoxRecords_DataLoaded(object sender, EventArgs e)
{
for (int idx = 0; idx < RGVBBoxRecords.Columns.Count; ++idx)
{
if (idx < headerstr.Count)
{
RGVBBoxRecords.Columns[idx].Header = headerstr[idx];
}
}
.......and in fact watching with debugger i can see that the Header field is setup properly but nothing happens really: on the screen there are the old strings.
Thanks alot for the quick response...
Hi Stefano Zambonin,
Unfortunatelly I couldn't reporoduce the described problem with our official 2009Q2 binaries. Can you please tell us which version of our controls are you using?
However a possible workaround is to subscribe to the AutoGeneratingColumn event:
void RGVBBoxRecords_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e) |
{ |
e.Column.Header = headerstr[counter]; |
counter++; |
} |
Please find attached a simple application.
Greetings,
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Ok, this way works but if possible i would prefer to use the other way (cleaner code).
I'm using 1 july Q9 2009 version.
Stefano Zambonin
Risorse Informatiche srl