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

dynamically Styling Header

3 Answers 54 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hemanth
Top achievements
Rank 1
Hemanth asked on 21 Nov 2012, 07:42 AM
Hi,

this is style i m using for the Header

<Style TargetType="telerik:GridViewHeaderCell" x:Key="HeaderStyleForAction">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="telerik:GridViewHeaderCell">
                                <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
                                    <Image  Name="imgAdd" Tag="{Binding TableCompositeKey}"  
                                           ToolTipService.ToolTip="Edit" HorizontalAlignment="Center"
                                           VerticalAlignment="Top" Source="../../IMAGES/Action.PNG" />
                                </StackPanel>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>


and i m dynamically generating columns

            gvdc = new GridViewDataColumn();
            gvdc.DataMemberBinding = new System.Windows.Data.Binding("ID");
            gvdc.HeaderCellStyle = (Style)this.Resources["HeaderStyleForAction"];
            radGridView1.Columns.Add(gvdc);

when i run, the Style is not applied to Column

m i going wrong somewhere? pls help me someone

Thanks..

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 23 Nov 2012, 04:56 PM
Hello Hemanth,

 I have tested this scenario using the code snippet you provided, but I could not reproduce any problem. For your convenience I have attached sample project. May I ask you to tell me how it differs from yours?

 You can modified the demo project, in order to reproduce the issue and resend it back to me.

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Hemanth
Top achievements
Rank 1
answered on 26 Nov 2012, 06:24 AM
Hi Yoan,

I m using navigation page, and using wcf data services for grid data
dynamically my columns generated with its data but problem is i m unable to apply style for dynamically generated columns.
Can u please tel, do we have any other way, to call Haeder Style for dynamically generated columns.

Thanks
0
Hemanth
Top achievements
Rank 1
answered on 13 Dec 2012, 12:22 PM
Hi All,
i found solution for it thanks
Tags
GridView
Asked by
Hemanth
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Hemanth
Top achievements
Rank 1
Share this question
or