Home Forums WPF controls Xceed DataGrid for WPF Issue Styling RowSelector

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

    I have followed the example to style the RowSelector. I am able to get the ItemIndex to show up as its content no problem.

    The issue is that the RowSelectorPane itself only allows enough space for 2 digits to be displayed (0-99) before it truncates the remaining digits. This is ok, if you have less than 100 rows of data in a grid, but when you have more you no longer can determine the idnex via the RowSelectorPane. Can someone provide an example on how to update either in XAML or progromatically the width of the RowSelectorPane to match the content width?

    I have made a number of attempts to get this to updated and have not been able to find a solution.

    Any help would be appreciated.

    Imported from legacy forums. Posted by Rob (had 4179 views)

    Xceed Support
    Member
    Post count: 5658

    You could create a dp that retrieves the count of data rows and returns the equivalent string length and bind the width property of the RowSelector to that property.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 462 views)

    User (Old forums)
    Member
    Post count: 23064

    Even explicitly setting the RowSelector Width property to be a fixed width does not seem to update the width of the RowSelectorPane.

    Can you provide a progromatic way of accessing the RowSelector for a Grid, such that I can manipulate the properties in code, vs in XAML, or provide a style that I may apply that shows how I might set this property?

    For example here is what I have tried:

    In the ItemIndexSelectorStyle,

    <Style x:Key=”itemIndexSelectorStyle”
    TargetType=”{x:Type xcdg:RowSelector}”>
    <Setter Property=”Content”
    Value=”{Binding RelativeSource={RelativeSource Self}, Path=ItemIndex}”/>
    <Setter Property=”FontWeight” Value=”6″/>
    <Setter Property=”Foreground” Value=”Black”/>
    <Setter Property=”Height” Value=”25″/>
    <Setter Property=”Width” Value=”150″/>
    </Style>

    The setting of the Width and Height properties has no effect on the the size of the RowSelector

    I have also tried updating the Width of the RowSelectorPane but that does nothing either.

    This is really starting to bug me.

    Imported from legacy forums. Posted by Rob (had 797 views)

    Xceed Support
    Member
    Post count: 5658

    Indeed, setting the width of the RowSelectorPane does not work since it has been explicitly defined in the TableViewScrollViewer template.

    That said, you will need to redo the template for the TableViewScrollViewer (cut and paste) in order to be able to change the width of the RowSelectorPane. Here is the style that you need. Search for RowSelectorPane and set its width through this style (set to 100 in this example).

    Goes to show that I should double check before answering!

    Imported from legacy forums. Posted by Jenny [Xceed] (had 5552 views)

    User (Old forums)
    Member
    Post count: 23064

    Hello Jenny,

    I am having a similar issue with the RowSelector pane and numbering. It seems that the template was changed to dynamically size to the content because on 4.2+ versions of the DataGridControl I see the pane resize to accommodate 3 digits easily. However our users are complaining that when there are 9 rows or less and scrolling occurs, the numbers become so small they don’t see them very well.

    I tried setting a template on the RowSelector but it still gets overridden when scrolling. Can I get a copy of the TableViewScrollViewer template that you are using?

    I am using the 4.2 Version of the DataGridControl. Thanks.

     -Ken 

    Imported from legacy forums. Posted by Ken (had 233 views)

    User (Old forums)
    Member
    Post count: 23064

    That link is dead….

     I need to resize the RowSelectorPane to use all available horizontal space…

    Imported from legacy forums. Posted by Stephen (had 686 views)

    User (Old forums)
    Member
    Post count: 23064

    Could you please upload the content? The provided link doesn’t work. Thank you.

    Imported from legacy forums. Posted by Marko (had 942 views)

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