Home Forums WPF controls Xceed DataGrid for WPF group header with width of grid?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #23243 |

    hi all,

    is it possible to have the group header have the full width of the grid? and also, if you only have one or two columns in your grid, the area right to the column-headers have the color of the column headers? its a bit complicating without images :), but in general, if you size the second of the two columns till the right end of the grid, this is what it should look like (but without the column sized)

    drawing:

    ———————————————————-|
    |x GROUP HEADER X |- expand here —> |
    |————————– |
    |Column 1|Column 2| -color of headers till here-> |
    |———–|———–| |
    | | | |
    | | | |

    i know its very confusing, but maybe you know what i basically want 🙂

    thank you for help

    Imported from legacy forums. Posted by Benno (had 4748 views)

    Odi [Xceed]
    Spectator
    Post count: 426

    Would it be simpler to say that you would simply always like the group header to span the width of the grid, regardless, of the configuration of the columns beneath, and furthermore, you would like to be able to look like it spans the width of the grid, even if the columns themselves don’t.

    Right?

    Odi

    Imported from legacy forums. Posted by Odi [Xceed] (had 370 views)

    User (Old forums)
    Member
    Post count: 23064

    yeah right 🙂

    Imported from legacy forums. Posted by Benno (had 231 views)

    User (Old forums)
    Member
    Post count: 23064

    no way to accomplish this? 🙁

    Imported from legacy forums. Posted by Benno (had 237 views)

    Xceed Support
    Member
    Post count: 5658

    You can create a Style for GroupHeaderControl and ColumnManagerRow in which you create a Setter that binds the MinWidth property of the objects to the ActualWidth of the ItemsPresenter.

    This can be done by using a RelativeSource set to AncestorType={x:Type ItemsPresenter}.

    <Setter Property=”MinWidth” Value=”{Binding RelativeSource={RelativeSource AncestorType={x:Type ItemsPresenter}}, Path=ActualWidth} />

    This way, the GroupHeaderControl and the ColumnManagerRow will be at minimum, as large as the viewport.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 332 views)

    User (Old forums)
    Member
    Post count: 23064

    Yeah great thanks, it works fine using MinWidth on the ColumnManagerRow
    the only problem is that it doesnt work using the AncestorType like you said. That way i still have the same behavior as before.
    If i do it with <Setter .. Value=”5000″/> it looks fine
    Is there another way to get the Width of the whole GridControl? I dont want to accomplish it using this “5000” value 🙂

    Imported from legacy forums. Posted by Benno (had 374 views)

    User (Old forums)
    Member
    Post count: 23064

    okay, i finally got it to work using your suggestion but with {x:Type ContentPresenter} as AncestorType

    thanks for your help marcus

    cheers

    Imported from legacy forums. Posted by Benno (had 281 views)

    Xceed Support
    Member
    Post count: 5658

    Yep… Or ScrollContentPresenter. I forgot that the ColumnManagerRow was not within the ItemsPresenter.

    Imported from legacy forums. Posted by Marcus [Xceed] (had 5936 views)

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.