I am using the RadRichTextBox with a HtmlDataProvider as a html editor. When I add a table the width comes out in the html as 626px. This is too big for where I wish to display the html, is there any way of restricting the size of the table when it gets added?
Many Thanks
Tracey
1 Answer, 1 is accepted
0
Iva Toteva
Telerik team
answered on 31 May 2011, 09:04 AM
Hello Tracey,
If you are creating a document in code-behind, i.e. you know how much rows and columns the table you wish to insert has, you can use the following method from RadRichTextBox's API:
In case you are using the UI that comes with RadRichTextBox - RadRichTextBoxRibbonUI and are inserting tables through the TableSizePicker, you can subscribe to the DocumentElementAdded and every time a Table is added, set its preferred Width to the value you wish to use. Here is the sample code for that:
Note that the data providers create a new document for every change in the property they are bound to. Thus, the subscription to the DocumentElementAdded event of the document must happen on document changed as follows:
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