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

How modify the width of the table column?

4 Answers 194 Views
RichTextBox (obsolete as of Q3 2014 SP1)
This is a migrated thread and some comments may be shown as answers.
Petirim
Top achievements
Rank 1
Petirim asked on 22 Oct 2012, 08:03 AM

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

4 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 23 Oct 2012, 10:21 AM
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.
0
Petirim
Top achievements
Rank 1
answered on 07 Nov 2012, 03:14 PM
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
0
Stefan
Telerik team
answered on 12 Nov 2012, 08:05 AM
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.
0
Petirim
Top achievements
Rank 1
answered on 12 Nov 2012, 01:01 PM
Thanks a lot, Stefan!
It works.

With best regards,
Igor
Tags
RichTextBox (obsolete as of Q3 2014 SP1)
Asked by
Petirim
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Petirim
Top achievements
Rank 1
Share this question
or