Home Forums WinForms controls Xceed Grid for WinForms Fine grain control over how grid lines are drawn

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

    Hello,

    My aim is to have more space between GroupByRows and the collection of cells above this. To achive this I’m inserting a SpacerRow into the headers collection of the group. I don’t want to increase the hight of the GroupByRow itself because this means the collapse group button is vertically align to the top and I’d like it to be aligned to the bottom. Inserting a space row works well, expect that a grid line is drawn between the SpacerRow and the GroupByRow and I’d like to remove this. I’ve tried handling the Paint event and niether the space nor the groupby seems to be able to draw over grid line. So my question is: Is there away to get more fine grained control over were grid lines are drawn? Or Is there a better way to apporach this problem.

    Cheers,
    Rob 

    Imported from legacy forums. Posted by Robert (had 1531 views)

    User (Old forums)
    Member
    Post count: 23064

    In this case, it is better to override the GroupManagerRow class, and repaint everything so it paints where you want when increasing the height of the row.  I have attached the overridden class to this post.  Once you’ve implemented it, you can use it in your project the following way :

        private void Form1_Load(object sender, System.EventArgs e)
        {    
          gridControl1.GroupAdded += new GroupAddedEventHandler(gridControl1_GroupAdded);
        }

        private void gridControl1_GroupAdded(object sender, GroupAddedEventArgs e)
        {
          CustomGroupManagerRow customGroupManagerRow = new CustomGroupManagerRow();
          e.Group.HeaderRows.Clear();
          e.Group.HeaderRows.Add( customGroupManagerRow );
        }
     

    This way, whether you add a group in code or a user drags a column header in the GroupByRow, all the groups will use the custom GroupManagerRow.

    Imported from legacy forums. Posted by André (had 2008 views)

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