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
1015
Text in the Row Selector column header
posted

Can I place text in the Row Selector column header?

I have set the RowSelectorNumberStyle to RowIndex so I can show line numbers there. But in my situation the line numbers have meaning - they are the "priorities" for the end-user. So I would like to add the word "Priority" as the RowSelectorHeader. There is a TextHAlign and TextVAlign property in  RowSelectorHeader, but there is no Text property.

How can I add the word 'Priority" as the header?

Thanks

Parents
No Data
Reply
  • 40
    Offline posted

    I know this post is old, but it's the top search result for this issue so in the hopes of helping someone in the future -- here's the solution:

    YourGridName.DisplayLayout.Bands[0].Override.RowSelectorHeaderStyle = RowSelectorHeaderStyle.SeparateElement;
    YourGridName.DisplayLayout.Bands[0].Override.RowSelectorWidth = ???;
    YourGridName.DrawFilter = new MyDrawFilter();
    
    
    
    
    class MyDrawFilter : IUIElementDrawFilter
    {
    	public MyDrawFilter()
    	{
    	}
    
    	public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams)
    	{
    		if (drawParams.Element is Infragistics.Win.UltraWinGrid.RowSelectorHeaderUIElement)
    			return DrawPhase.BeforeDrawImage;
    		else
    			return DrawPhase.None;
    	}
    
    	public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
    	{
    		if (drawPhase == DrawPhase.BeforeDrawImage && drawParams.Element is Infragistics.Win.UltraWinGrid.RowSelectorHeaderUIElement)
    		{
    			drawParams.DrawString(drawParams.Element.Rect, "MyText", false, false);
    
    			return true;
    		}
    
    		return false;
    	}
    }

Children
No Data