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
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; } }
Hi Brian Fallon
Can you please elaborate with a code snapshot that how i can display custom text on RowSelectorHeader
Hello,
If you have any other questions with this matter please do not hesitate to ask.
You can add customized text to these elements using the IUIElementCreationFilter interface (the classname for the row selector element is Infragistics.Win.UltraWinGrid.RowSelectorUIElement).
Note that you will probably have to set the UltraGrid.DisplayLayout.Override.RowSelectorWidth property to a value that is large enough to accommodate that string value.