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

Right To Left Cells

3 Answers 71 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Raftari
Top achievements
Rank 1
Raftari asked on 22 Dec 2015, 08:02 AM
How can I set Right-To-Left property of GridView Cells based on the data coming from database?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 22 Dec 2015, 09:48 AM
Hi ,

Thank you for writing.

You can make the whole grid right to left with this property:
radGridView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;

To make just certain cells, you can use the CellFormatting event:
void radGridView1_CellFormatting(object sender, Telerik.WinControls.UI.CellFormattingEventArgs e)
{
    if (e.ColumnIndex == 1)
    {
        e.CellElement.RightToLeft = true;
    }
    else
    {
        e.CellElement.ResetValue(RadElement.RightToLeftProperty, ValueResetFlags.Local);
    }
}

I hope this helps.

Regards,
Stefan
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Raftari
Top achievements
Rank 1
answered on 22 Dec 2015, 01:31 PM
No, this is not solution. I mean based on the data coming from database. For example, if the data in the cell is in Persian language then the cell should be right to left and if the data is in English language then the cell should be left to right or if the data is numeric then the cell should also be left to right. How can I do this?
0
Accepted
Stefan
Telerik team
answered on 23 Dec 2015, 08:35 AM
Hello Raftari,

RadGridView does not have a functionality to determine whether data in a cell is right to left or not, so it is up to you to determine that and using the API I provided to set the cell RightToLeft property.

Regards,
Stefan
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Raftari
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Raftari
Top achievements
Rank 1
Share this question
or