Change the DataGrid Row Header??
Last post 05-12-2008 9:35 PM by Allen Chen – MSFT. 3 replies.
Sort Posts:
05-08-2008 8:58 AM
Change the DataGrid Row Header??

 Hello All,

I want to change the RowHeader of a DataGrid (just like changing the ColumnHeader) so can any one tell me how to do that?

 

For the ColumnHeader I did the following :

<my:DataGridTextBoxColumn.Header>

<StackPanel Orientation="Horizontal">

<TextBlock FontSize="12" Text="Arabic 1st Name"/>

<Path x:Name="pathDescend" Visibility="Collapsed" StrokeLineJoin="Round" Stroke="#FF808080" Fill="#FF808080"

Data="M 0 0 L 4 4 L 8 0 Z"

Height="11.521" VerticalAlignment="Center" Width="13.145"/>

<Path x:Name="pathAscend" StrokeLineJoin="Round" Stroke="#FF808080"

Fill="#FF808080"

Data="M 0 0 L 4 4 L 8 0 Z"

Height="11.521" VerticalAlignment="Center" Width="13.145"/>

</StackPanel>

</my:DataGridTextBoxColumn.Header>

and that works fine (I use it to sort the data)

 

Thanks. 

tornado538

Loading...
Joined on 12-09-2007
Amman- Jordan
Posts 5
05-12-2008 1:25 AM
Re: Change the DataGrid Row Header??

Hi:

  You can set:

           DataGrid.HeadersVisibility=DataGridHeaders.Column

  and add the row header via the first column.

Regards

 

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Allen Chen – MSFT

Loading...
Joined on 03-16-2007
Posts 1,310
05-12-2008 2:38 AM
Re: Change the DataGrid Row Header??

first of all thanks Allen,

but what you suggest will hide the row header(I try it) and what I want to do is to change the template of the row header ,say that I want to put a TextBlock with some text in it.

 

Thanks

Mohammad Shahrouri 

tornado538

Loading...
Joined on 12-09-2007
Amman- Jordan
Posts 5
05-12-2008 9:35 PM
Marked as Answer
Re: Change the DataGrid Row Header??

Hi:

  When we hide the row header we can let the first column be the row header and can custom it via CellTemplate.

Regards

Sincerely,
Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Allen Chen – MSFT

Loading...
Joined on 03-16-2007
Posts 1,310