This is a migrated thread and some comments may be shown as answers.

Issue with group header allignment

1 Answer 104 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Pinaki Basu
Top achievements
Rank 1
Pinaki Basu asked on 05 Aug 2010, 01:13 PM
Hi,

I am using ColumnGroupsViewDefinition to bind to my grid , however i want to allign the group header as right allign but watever i try it doesnt work , i am able to allign the columns wihin the group but allignment of group header text is what i really need.

Please let me know whether this is possible or not.

Thanks
Pinaki

1 Answer, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 10 Aug 2010, 04:08 PM
Hello Pinaki Basu,

Thank you for writing.

You can set the TextAlignment property for the GridColumnGroupCellElement in the ViewCellFormatting event. Please note that before applying a new alignment, you have to unbind the property:

void radGridView1_ViewCellFormatting(object sender, CellFormattingEventArgs e)
{
    if (e.CellElement is GridColumnGroupCellElement || e.CellElement is GridHeaderCellElement)
    {                
        e.CellElement.UnbindProperty(LightVisualElement.TextAlignmentProperty);
        e.CellElement.TextAlignment = ContentAlignment.MiddleRight;
    }
}

I how you find this useful. Let me know if you have any other questions.

Sincerely yours,
Martin Vasilev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Pinaki Basu
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Share this question
or