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

RadEditor in Grid a no show / Customizing rows based on data.

3 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay Leffue
Top achievements
Rank 1
Jay Leffue asked on 18 Aug 2010, 03:44 PM
I have two issues.

1. I have a RadEditor in a RadGrid which works fine, until I set the Grid to use Ajax.  Then the Editor control becomes useless and its contents hidden.  What is the work around for this?

2. Depending on user privileges I need different options to show in the grid.  The grid is a grid of info, much like a forum.  If the creator of a row is using the system I need a column to have an edit button that allows direct edit of the record (like my code has now).  However, if it is not the creator, the 'Edit' button needs to be replaced by a 'Reply to' button that acts as an insert command prepopulating the edit box with "Reply to Comment X".  So how do I code this so it determines which edit/insert button to show based on the row priveleges?

Heres my current code for the control:

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grdNotes">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdNotes" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />

<telerik:RadGrid ID="grdNotes" runat="server" GridLines="None" Skin="Windows7">
<MasterTableView ShowHeader="False" ShowHeadersWhenNoRecords="False"
        TableLayout="Fixed" AutoGenerateColumns="False" DataKeyNames="ID" ClientDataKeyNames="ID" >
    <Columns>
        <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID"
            SortExpression="ID" UniqueName="ID" Visible="false" ReadOnly="true">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="VisibleID" DataType="System.Int32"
            HeaderText="ID" SortExpression="VisibleID" UniqueName="VisibleID" ReadOnly="true" >
            <HeaderStyle Width="20px" />
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn CommandName="Edit" ButtonType="ImageButton" UniqueName="Edit" ImageUrl="~/Images/Edit.png">
                        <HeaderStyle Width="50px" />
        </telerik:GridButtonColumn>     
        <telerik:GridTemplateColumn HeaderText="Notes" UniqueName="Notes" ReadOnly="false">  
                            <EditItemTemplate>
                                <telerik:RadEditor ID="editNotes" ShowSubmitCancelButtons="False" runat="server"
                                    Content='<%# Bind("Notes") %>' ToolsFile="~/ToolsFileLimited.xml" Height="200px" Width="1000px" EnableResize="false" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("Notes") %>' />
                            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="DateCreated" DataType="System.DateTime"
            HeaderText="Date Created" SortExpression="DateCreated" UniqueName="DateCreated" ReadOnly="true">
            <HeaderStyle Width="100px" />
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="CreatedBy" HeaderText="CreatedBy"
            SortExpression="Created By" UniqueName="CreatedBy" ReadOnly="true">
            <HeaderStyle Width="100px" />
        </telerik:GridBoundColumn>
    </Columns>


</MasterTableView>
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
</telerik:RadGrid>

3 Answers, 1 is accepted

Sort by
0
Jay Leffue
Top achievements
Rank 1
answered on 18 Aug 2010, 05:54 PM
Solved #2 with the code behind of OnItemDataBound.  Working correctly there.

Still, this grid must update through ajax, how do i fix issue #1?
0
Mira
Telerik team
answered on 23 Aug 2010, 07:53 AM
Hello Jay,

To implement the desired functionality, I recommend that you use the GridHTMLEditorColumn. You can see how it works in ajaxified grid here.
If you want to use the RadEditor as editor in template column of a RadGrid, you can examine this knowledge base.

I hope this helps.

Sincerely yours,
Mira
the Telerik team
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
0
Jay Leffue
Top achievements
Rank 1
answered on 23 Aug 2010, 02:07 PM
Thanks, did the trick!
Tags
Grid
Asked by
Jay Leffue
Top achievements
Rank 1
Answers by
Jay Leffue
Top achievements
Rank 1
Mira
Telerik team
Share this question
or