HideSelection doesn't

4 posts, 0 answers
  1. Matthew
    Matthew avatar
    16 posts
    Member since:
    Oct 2010

    Posted 23 Nov 2011 Link to this post

    Hi there,

    I am working on a custom theme based on ControlDefault
    I have a form containing multiple grids and i want to use the HideSelection property to remove all row and cell highlighting when focusing on a different grid.
    I've managed to get the theme to do this mostly, the only part i cant figure out is how to remove the cell highlight (see attached screen shot).

    I've removed the border from GridDataCellElement.IsCurrent, but left the one for GridDataCell.IsSelected. it seems like no matter what i try, the border still remains.

    Hope someone can help!

    Cheers,
    Matt
  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 25 Nov 2011 Link to this post

    Hi Matthew,

    It seems that there is an issue with the cell styling in this scenario. The HotTracking state is not updated correctly for the cell and it is not possible to disable the cell border by using the Visual Style Builder tool. I added this issue in our issue tracking system and it will be addressed in one of our upcoming releases.

    You can work around the issue by using the CellFormatting event. Please consider the sample below:
    void radGridView1_CellFormatting(object sender, CellFormattingEventArgs e)
    {
        if (e.CellElement.IsCurrent && !e.CellElement.RowElement.HotTracking)
        {
            e.CellElement.DrawBorder = false;
            e.CellElement.DrawFill = false;
        }
        else
        {
            e.CellElement.ResetValue(LightVisualElement.DrawFillProperty, ValueResetFlags.Local);
            e.CellElement.ResetValue(LightVisualElement.DrawBorderProperty, ValueResetFlags.Local);
        }
    }

    I hope this helps. If you need further assistance, do not hesitate to ask.
     
    All the best,
    Jack
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Matthew
    Matthew avatar
    16 posts
    Member since:
    Oct 2010

    Posted 27 Nov 2011 Link to this post

    Hi Jack,

    Thanks for your help with this. I've disabled hottracking and that seems to have fixed it.

    Regards,
    Matt
  5. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 30 Nov 2011 Link to this post

    Hello Matthew,

    I am glad that I could help. Should you have any other questions, feel free to contact us.
     
    Best wishes,
    Jack
    the Telerik team

    Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.

Back to Top