Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
How do I hide the dotted frame around clicked row once set SelectTypeRow to None?
posted

Hello guys,

I disabled row selection by :

grid.DisplayLayout.Override.SelectTypeRow = SelectType.None;

However, there's a doted like frame around each row once I mouse click that row.

Just wonder if we have some way to get rid of that frame?

Thanks,

Elton

  • 990
    posted

    Hi Elton,

    The only way I know to do this is with a DrawFilter. You create a DrawFilter by implementing IUIElementDrawFilter like this:

        public class NoFocusDrawFilter : IUIElementDrawFilter

        {

            bool IUIElementDrawFilter.DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)

            {

                return true;

            }

     

            DrawPhase IUIElementDrawFilter.GetPhasesToFilter(ref UIElementDrawParams drawParams)

            {

                return Infragistics.Win.DrawPhase.BeforeDrawFocus;

            }

        }

    Then, in the form initialisation set the draw filter on the grid:

    ultraGrid.DrawFilter = new NoFocusDrawFilter(); 

    It is not uncommon to implement the DrawElement and GetPhaseToFilter methods in the containing form class then set the draw filter like this:

    routeGrid.DrawFilter = this;

    Hope this helps,

    Andy.