How modify the width of the table column?

5 posts, 0 answers
  1. Petirim
    Petirim avatar
    7 posts
    Member since:
    Apr 2007

    Posted 22 Oct 2012 Link to this post

    Hi,

     How can I change the width of the current column in the table with using ChangeTableGridColumnWidth method?

    How could I get the current table, current gridColumnIndex?

     I use 2012.2.912.40 RadControls version.

    Regards,
    Igor

  2. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 23 Oct 2012 Link to this post

    Hi Igor,

    Thank you for writing.

    Please refer to the following documentation article which explains how to resize the columns programatically: http://www.telerik.com/help/winforms/gridview-columns-resizing-columns-programatically.html.
     
    The current column can be accessed via the CurrentColumn property of the grid.

    I hope this helps.

    All the best,
    Stefan
    the Telerik team
    You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Petirim
    Petirim avatar
    7 posts
    Member since:
    Apr 2007

    Posted 07 Nov 2012 Link to this post

    Hi Stefan,

    I meant the RichTextBox ChangeTableGridColumnWidth(Table table, int gridColumnIndex, TableWidthUnit width) method.
    Can you please give me some example of this method using? How could I get a particular table,column in richTextBox Document?

    Thank you,
    Igor
  5. Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 12 Nov 2012 Link to this post

    Hi Igor,

    Please excuse me for the misunderstanding. Here is how you can set the current column width in the current table in RadRichTextBox:
    void radButton1_Click(object sender, EventArgs e)
    {
        TableCellLayoutBox box = radRichTextBox1.Document.CaretPosition.GetCurrentTableCellBox();
        TableCell cell = box.AssociatedTableCell;
         
        TableRow row = cell.Row;
        Table table = row.Table;
     
        radRichTextBox1.ChangeTableGridColumnWidth(table, cell.GridColumnIndex, new TableWidthUnit(200f));
    }

    I hope this helps

    All the best,
    Stefan
    the Telerik team
    Q3’12 of RadControls for WinForms is available for download (see what's new). Get it today.
  6. Petirim
    Petirim avatar
    7 posts
    Member since:
    Apr 2007

    Posted 12 Nov 2012 Link to this post

    Thanks a lot, Stefan!
    It works.

    With best regards,
    Igor
Back to Top
UI for WinForms is Visual Studio 2017 Ready