dynamically Styling Header

4 posts, 0 answers
  1. Hemanth
    Hemanth avatar
    24 posts
    Member since:
    Mar 2011

    Posted 21 Nov 2012 Link to this post

    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..
  2. Yoan
    Admin
    Yoan avatar
    1069 posts

    Posted 23 Nov 2012 Link to this post

    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.

  3. DevCraft banner
  4. Hemanth
    Hemanth avatar
    24 posts
    Member since:
    Mar 2011

    Posted 26 Nov 2012 Link to this post

    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
  5. Hemanth
    Hemanth avatar
    24 posts
    Member since:
    Mar 2011

    Posted 13 Dec 2012 Link to this post

    Hi All,
    i found solution for it thanks
Back to Top