RadGrid - itemtemplate vs edititemtemplate

Thread is closed for posting
4 posts, 0 answers
  1. Stacy
    Stacy avatar
    98 posts
    Member since:
    Dec 2010

    Posted 15 Mar 2012 Link to this post

    Hi,

    I am having an issue that I hope you can help me out with.  Perhaps I am using item template and edit item template wrong.  I have a grid that contains an <itemtemplate> and an <edititemtemplate>.  I was under the assumption that when my grid loads up in view mode, it would display what's in the <itemtemplate>.  Then when I go to edit mode, it would display the items in <edititemtemplate>.  However I am seeing that it's using <itemtemplate> in both cases.  Is this how it's supposed to work?  My grid code is below:  (keep in mind some custom controls are in the grid and i can tell that it's using <itemtemplate> in view and edit mode because of the LabelText "item temp column".

    <wasp:WLPGrid
        ID="GroupGrid"
        EditMode="InPlace"
        runat="server"
        GridLines="None"
        AutoGenerateColumns="False"
        Width="100%"
        AutoInsertOnAdd="false"
        AllowMultiRowEdit="true"
        skin=""
        >
     
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
     
        <MasterTableView CommandItemDisplay="Top" DataKeyNames="Key" Width="100%">
            <CommandItemTemplate></CommandItemTemplate>
            <Columns>
                <wasp:GridTemplateControl UniqueName="HeaderColumns">
                    <ItemTemplate>
                        <table width="100%">
                          <tr>
                            <td colspan="2">
                                <wasp:CheckBoxControl ID="IsGroupSelected" LabelText="Selected" runat="server" ResourceName="IsGroupSelected" Value='<%# Bind("IsGroupSelected") %>' ReadOnly="true" />
                            </td>
                          </tr>
                          <tr>
                            <td>
                                <wasp:TextBoxControl ID="EnglishDesc" LabelText="item temp column" runat="server" ResourceName="EnglishDesc" Value='<%# Bind("EnglishDesc") %>' ReadOnly="true" />
                            </td>
                            <td>
                                <wasp:TextBoxControl ID="FrenchDesc" LabelText="French Desc:" runat="server" ResourceName="FrenchDesc" Value='<%# Bind("FrenchDesc") %>' ReadOnly="true" />
                            </td>
                          </tr>
                          <tr>
                            <td>
                                <wasp:ComboBoxControl ID="DatabaseSecurityRoleId" LabelText="Database Role" runat="server" Type="DatabaseSecurityRoleId" ondatabinding="PopulateCombo" ResourceName="DatabaseSecurityRoleId" Value='<%# Bind("DatabaseSecurityRoleId") %>' ReadOnly="true"></wasp:ComboBoxControl>
                            </td>
                            <td>
                                <wasp:ComboBoxControl ID="GuiSecurityRoleId" LabelText="GUI Role" runat="server" Type="GuiSecurityRoleId" ondatabinding="PopulateCombo" ResourceName="GuiSecurityRoleId" Value='<%# Bind("GuiSecurityRoleId") %>' ReadOnly="true"></wasp:ComboBoxControl>
                            </td>
                          </tr>
                        </table>
                        <hr />
                    </ItemTemplate>
                    <EditItemTemplate>
                        <table width="100%">
                          <tr>
                            <td>
                                <wasp:CheckBoxControl ID="IsGroupSelected" LabelText="Selected" runat="server" ResourceName="IsGroupSelected" Value='<%# Bind("IsGroupSelected") %>' ReadOnly="false" />
                            </td>
                          </tr>
                          <tr>
                            <td>
                                <wasp:TextBoxControl ID="EnglishDesc" LabelText="edit item column" runat="server" ResourceName="EnglishDesc" Value='<%# Bind("EnglishDesc") %>' ReadOnly="true" />
                            </td>
                            <td>
                                <wasp:TextBoxControl ID="FrenchDesc" LabelText="French Desc:" runat="server" ResourceName="FrenchDesc" Value='<%# Bind("FrenchDesc") %>' ReadOnly="true" />
                            </td>
                          </tr>
                          <tr>
                            <td>
                                <wasp:ComboBoxControl ID="DatabaseSecurityRoleId" LabelText="Database Role" runat="server" Type="DatabaseSecurityRoleId" ondatabinding="PopulateCombo" ResourceName="DatabaseSecurityRoleId" Value='<%# Bind("DatabaseSecurityRoleId") %>' ReadOnly="true"></wasp:ComboBoxControl>
                            </td>
                            <td>
                                <wasp:ComboBoxControl ID="GuiSecurityRoleId" LabelText="GUI Role" runat="server" Type="GuiSecurityRoleId" ondatabinding="PopulateCombo" ResourceName="GuiSecurityRoleId" Value='<%# Bind("GuiSecurityRoleId") %>' ReadOnly="true"></wasp:ComboBoxControl>
                            </td>
                          </tr>
                        </table>
                        <hr />
                    </EditItemTemplate>
                </wasp:GridTemplateControl>
            </Columns>
        </MasterTableView>
  2. Tsvetina
    Admin
    Tsvetina avatar
    1874 posts

    Posted 20 Mar 2012 Link to this post

    Hello Stacy,

    You have correctly understood the idea of the template column but from what I see your ItemTemplate and EditItemTemplate are identical, what is the difference that you expect to see in this scenario?

    Regards,
    Tsvetina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stacy
    Stacy avatar
    98 posts
    Member since:
    Dec 2010

    Posted 20 Mar 2012 Link to this post

    The templates are identical just because i pasted them that way, i changed the labels on my textboxbox's so that's how i knew it was always using the item template.  Was just wondering if that's because the edit mode is "in line"?
  5. Tsvetina
    Admin
    Tsvetina avatar
    1874 posts

    Posted 23 Mar 2012 Link to this post

    Hi Stacy,

    This would not make a difference, the GridTemplateColumn would always use its EditItemTemplate when in edit mode. If you still experience this problem, would it be possible that you open a support ticket and send us a runnable sample demonstrating the issue. We will debug it and let you know why it happens and how to fix it.

    All the best,
    Tsvetina
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top