Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xamDataGrid - indenting nested levels

I have a xamDataGrid with two levels of data. (see other question on SO).

There is very little visually that shows where one level of data starts and a seconds begins. Take a look at this snippet from the xamFeatureBrowser:

enter image description here

What I want, is to indent the second level a little. RecordPresenter has a NestedContentMargin property, but it's read-only...

An alternative, would be to display some kind of thin footer for each second level grid.

like image 212
Vegar Avatar asked Apr 01 '11 13:04

Vegar


1 Answers

This one turned out to be easier then expected. I'm sure I tried this before I asked the question, but for some reason, I failed. When I showed the problem to a colleague, he made it work just like that. :-/

So here is the style:

<Style TargetType="{x:Type igDP:DataRecordPresenter}" x:Key="NestedRecordStyle">
  <Setter Property="Margin"  Value="20,0,0,0"/>
</Style> 

and here's how I applied it to my nested fieldset:

<igDP:FieldLayout ParentFieldLayoutKey="MainLayout">
  <igDP:FieldLayout.Settings>
    <igDP:FieldLayoutSettings DataRecordPresenterStyle="{StaticResource NestedRecordStyle}"/>
  </igDP:FieldLayout.Settings>
  ...
</igDP:FieldLayout>

Just like that...

edit: Updated typo

like image 82
Vegar Avatar answered Oct 19 '22 23:10

Vegar