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

Adding tools to GridHTMLEditorColumn

2 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 11 Mar 2010, 06:49 PM
Ok so I really like RadGrid, and now I have been using the GridHTMLEditorColumn column type more and more. One issue I am having is that i would like to add the remaining tool bars to the control so that the user has more control of the HTML. I have searched the forums and have seen some discussion, but none of the solutions have worked for me.

1. How do I add the "hidden" tools since this appears to be radeditor?
2. How can I maximize the width of the control in the RadGrid edit form?

Good day to us all.

Ryan

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 12 Mar 2010, 09:16 AM

Hello,

You can access the Editor control and add the required tools from code behind. Also you can set the width for each controls from server side. Here is the code example.

C#:

 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        if (e.Item is GridEditableItem && e.Item.IsInEditMode)  
        {  
            GridEditFormItem editItem = (GridEditFormItem)e.Item;  
            RadEditor editor = (RadEditor) editItem["Editor"].Controls[0];  
 
            // Add the required tools to editor  
            EditorToolGroup main = new EditorToolGroup();  
            editor.Tools.Add(main);  
            EditorTool copy = new EditorTool();  
            copy.Name = "Copy";  
            copy.ShortCut = "CTRL+C";  
            main.Tools.Add(copy);  
            EditorTool paste = new EditorTool();  
            paste.Name = "Paste";  
            paste.ShortCut = "CTRL+V";  
            main.Tools.Add(paste);  
 
            // Set the width for controls in edit form  
            editor.Width = Unit.Pixel(800);  
            TextBox textBox = (TextBox)editItem["CompanyName"].Controls[0];  
            textBox.Width = Unit.Pixel(500);  
        }  
    } 

-Shinu.

0
Snehith
Top achievements
Rank 1
answered on 16 Apr 2015, 08:25 AM
How to add color tool properties to the tool bar?
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Snehith
Top achievements
Rank 1
Share this question
or