Right To Left Cells

4 posts, 1 answers
  1. Raftari
    Raftari avatar
    2 posts
    Member since:
    Dec 2015

    Posted 22 Dec 2015 Link to this post

    How can I set Right-To-Left property of GridView Cells based on the data coming from database?
  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 22 Dec 2015 Link to this post

    Hi Raftari,

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Raftari
    Raftari avatar
    2 posts
    Member since:
    Dec 2015

    Posted 22 Dec 2015 in reply to Stefan Link to this post

    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?
  5. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 Dec 2015 Link to this post

    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
Back to Top