We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Programmatically change head text

Hello,

i have this code for column

<syncfusion:GridNumericColumn MappingName="FQ_02733" HeaderText="Spotřeba plynu 2733" TextAlignment="Right" NumberDecimalDigits="2" NumberDecimalSeparator=",">

                                <syncfusion:GridNumericColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <TextBlock x:Name="Grid_FQ_02733" Text="{TemplateBinding Content}">
                                            <TextBlock.ContextMenu>
                                                <ContextMenu>
                                                    <MenuItem Header="Změnit název" Click="MenuItem_ChangeValue" />
                                                </ContextMenu>
                                            </TextBlock.ContextMenu>
                                        </TextBlock>
                                    </DataTemplate>
                                </syncfusion:GridNumericColumn.HeaderTemplate>

  </syncfusion:GridNumericColumn>

I initiate data to data grid after click on button, by default is table empty. At start application i change column header text programmatically from user settings (user can rename column header).

And here is problem, by clicking to load data and initiate data source. After set items source change data grid head text to default value. I don't understand why, because text in column header has been already changed programmatically from user settings.

Thans for help :-)

1 Reply

FP Farjana Parveen Ayubb Syncfusion Team July 2, 2015 03:05 AM UTC

Hi Martin,

Thank you for contacting Syncfusion support.

We have analyzed your query and we are unable to reproduce the reported issue “Default header text is applied load the data in grid” on our end. We have changed the header text before loading SfDataGrid and also before loading the data, its works fine on our end. Could you please share your exact scenario about your requirement that will help us to server you better.

Please refer the sample in the following location we use for testing.

Sample Location: SfDataGrid_HeaderText


If the issue is still reproduced in your end, please revert us the modified sample which replicates the issue that would be more helpful for us to serve you better.
Regards,
Farjana Parveen A


Loader.
Up arrow icon