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

Set RadEditors content in FormTemplate

4 Answers 80 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 01 Sep 2008, 09:53 AM
Hi,
How do I set the editors content when updating a row?
I need something like this:
<FormTemplate> 
     <table> 
        <tr> 
            <td>Text:</td> 
            <td> 
                <telerik:RadEditor ID="Text" runat="server" Skin="Gray" > 
                    <Content><%# Bind("Text") %></Content
                </telerik:RadEditor> 
            </td> 
         </tr> 
     </table> 
</FormTemplate> 
<Columns> 
     <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn"
                </telerik:GridEditCommandColumn> 
     <telerik:GridHTMLEditorColumn UniqueName="Text" DataField="Text" HeaderText="Text" Display="false" /> 
</Columns> 

4 Answers, 1 is accepted

Sort by
0
Mattias
Top achievements
Rank 1
answered on 01 Sep 2008, 01:30 PM
Hi again!
I could really need some help on this!
I also get the famous error (when searching throu your website): Specified cast is not valid, on multiple controls when using Bind and clicking "Add new record".
<FormTemplate> 
... 
<tr> 
                        <td>Visas frÃ¥n:</td> 
                        <td> 
                            <telerik:RadDatePicker ID="StartDate" runat="server" SelectedDate='<%# Bind("StartDate") %>'
                            </telerik:RadDatePicker> 
                        </td> 
                    </tr> 
                    <tr> 
                        <td>Aktiverad:</td> 
                        <td> 
                            <asp:CheckBox ID="IsEnabled" runat="server" Checked='<%# Bind("IsEnabled") %>' /></td
                    </tr> 
... 
</FormTemplate> 

I saw some example when someone turned the checkbox into a usercontrol, is that still the approach to go?

Is it possible to move the bind (when updating) values to code behind?

0
Missing User
answered on 02 Sep 2008, 08:21 AM
Hi Mattias,

Binding a RadDatePicker, RadTimePicker, or RadDateTimePicker control to a data source is easy provided you use the DbSelectedDate property. You can review the following online demo:

http://demos.telerik.com/aspnet/prometheus/Calendar/Examples/DatePicker/DataBinding/DefaultCS.aspx


Best wishes,
Plamen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mattias
Top achievements
Rank 1
answered on 02 Sep 2008, 11:11 AM
Ok, thanks!
But, what about the checkbox for example, do I really need to create a usercontrol for it (and for every other asp:control)?

And how do I bind the RadEditor control?
0
Sebastian
Telerik team
answered on 02 Sep 2008, 11:23 AM
Hello Mattias,

To add checkboxes or other controls to the grid edit form, consider using FormTemplate custom edit form (as you already did), WebUserControl custom edit form or embed these editors inside edit templates of template columns.

Concerning how to bind RadEditor when part of the grid edit form:
Consider using either built-in GridHTMLEditorColumn or use the approach presented in the following KB article.

Best regards,
Stephen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Mattias
Top achievements
Rank 1
Answers by
Mattias
Top achievements
Rank 1
Missing User
Sebastian
Telerik team
Share this question
or