Home Forums WinForms controls Xceed Grid for WinForms Row selector custom painting problem

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

    Hello,

     

    I need to custom paint all my grids in the application so I took I ride through the grids/detail grids related posts to find out how can I customize the appearance of certain grid components. Anyways, I still have some problems in achieving my goal. Here I’m trying to explain them:

    My grids contain detail grids that can also contain detail grids and so on (so no groups, just inner detail grids). The grids are not data bound to any data source, the data is feed run time based on certain run time data model.

    I use a CustomRowSelectorPane and a CustomRowSelector to customize the row selector appearance. I want no row separator lines drawn on the row selector. For this reason I override the PaintBackground of the CustomRowSelectorPane, do my painting here and also I override the PaintBackground of the CustomRowSelector and do nothing (this way those horizontal lines do not appear anymore when a row is selected).Until here all works great.

    But when a detail grid is expanded, on the row selector pane appears a portion drawn in the default way (default background color and  that row separator line) at detail grid top as well as on detail grid bottom side. If I set detailGrid.TopMargin.Height = 0; and detailGrid.BottomMargin.Height = 0 then this portions disappears. But I would like to have some top&bottom space for each detail grid. How can I customize (custom paint) that row selector portion?

    Also, how can I change the default +/- of the detail grids with custom +/- icons? In your CustomUI sample you replaced the original +/- but there you work with groups and I have only detail grids.

     

    Thanks,

    Bogdan

    Imported from legacy forums. Posted by bogdip (had 1025 views)

    User (Old forums)
    Member
    Post count: 23064

    Ok, I found the solution to my first problem. The idea is to use the custom row selector in the custom spacer row of the details grid. And this can be done in the initialization of the details grid:

     

    MyDetailGrid detail = new MyDetailGrid(new CustomDetailGridMargin(),
                    new CustomSpacerRow(rowSelector1), new CustomSpacerRow(rowSelector2), new CustomFixedColumnSplitter());

     

    where:

     RowSelector rowSelector1 = (RowSelector)Activator.CreateInstance(rowSelectorType);
     RowSelector rowSelector2 = (RowSelector)Activator.CreateInstance(rowSelectorType);

     or simply :

     

     RowSelector rowSelector1 = new CustomRowSelector();
     RowSelector rowSelector2 = new CustomRowSelector();

     

    Regarding the second issue, the +/- icons skinning, it seems it can’t be done: http://xceed.com/CS/forums/thread/3268.aspx

     

    Imported from legacy forums. Posted by bogdip (had 1083 views)

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