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

How to add row headers column?

8 Answers 305 Views
GridView
This is a migrated thread and some comments may be shown as answers.
srikanth
Top achievements
Rank 1
srikanth asked on 11 Jun 2013, 12:51 PM
Hello!

How can i add column of row headers, to have not only column headers but row headers too??

please suggest me asap!

Thanks and regards!

8 Answers, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 11 Jun 2013, 03:01 PM
Hi Srikanth,


Have you checked this demo? The same is applicable to WPF as well.


Regards,
Vanya Pavlova
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
srikanth
Top achievements
Rank 1
answered on 12 Jun 2013, 09:42 AM
Hello Vanya Pavlova !
Thank you. It works
One more question: how can i make column headers text vertically not horizontally? The main condition of this feature is that implementation have to be not in XAML but in c# code, and adding columns from c#code!!!

Thanks in advance!!!
0
Vanya Pavlova
Telerik team
answered on 12 Jun 2013, 10:15 AM
Hi Srikanth,


You may try something like the following:
<telerik:RadGridView  ItemsSource="{Binding Collection}">
            <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn  DataMemberBinding="{Binding Property1}" Width="40">
                    <telerik:GridViewDataColumn.Header>
                        <Border Height="100" Width="100" >
                            <TextBlock  Text="Store" HorizontalAlignment="Left" TextWrapping="Wrap"  FontWeight="Bold" Height="auto" TextAlignment="Center"  VerticalAlignment="Bottom" >
                            <TextBlock.RenderTransform>
                                <RotateTransform Angle="-90" />
                            </TextBlock.RenderTransform>
                            </TextBlock>
                        </Border>
                    </telerik:GridViewDataColumn.Header>
                </telerik:GridViewDataColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>



Regards,
Vanya Pavlova
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
srikanth
Top achievements
Rank 1
answered on 12 Jun 2013, 01:10 PM
Hello !
I know about this way, but if i'm adding columns dynamically from c# code? How can i implement it?

Thanks and regards!!
0
Accepted
Vanya Pavlova
Telerik team
answered on 12 Jun 2013, 01:15 PM
Hello Srikanth,



The Header property of a column is of type System.Object - you may store the desired header in a central place in XAML and once you have access to these columns you may set its headers from code-behind through accessing the resource collection of your application.


Have a great day!


Regards,
Vanya Pavlova
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
srikanth
Top achievements
Rank 1
answered on 13 Jun 2013, 01:15 PM
Hello Vanya Pavlova,

Thank you a lot!
Have a great day too!
0
srikanth
Top achievements
Rank 1
answered on 22 Jun 2013, 03:46 PM
Hello Vanya Pavlova!

How can i add tooltip for every column headers also dynamically from c# code???

Thanks in Advance!
0
Dimitrina
Telerik team
answered on 26 Jun 2013, 12:51 PM
Hi,

You could assign the ToolTip in code behind for the object you set as column's Header. 
For example:

TextBlock myHeader = new TextBlock();
ToolTip myHeaderToolTip = new ToolTip();
myHeaderToolTip.Content = "My tooltip";
myHeader.ToolTip = myHeaderToolTip;
this.clubsGrid.Columns[0].Header = myHeader;

I hope this helps.

Regards,
Didie
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
GridView
Asked by
srikanth
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
srikanth
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or