Very basic question

2 posts, 0 answers
  1. Dave
    Dave avatar
    11 posts
    Member since:
    Dec 2011

    Posted 06 Jul 2012 Link to this post

    Guys I am sorry I am following the below video tutorial and I am stumped


    http://tv.telerik.com/watch/aspnet/radgrid/radgrid-edit-templates 

    When I get to the part where I create Form Template. The author goes "You do not want to see me put this controls on" so then it fast forwards tills all the text boxes and buttons are on!!!!!!!

    Thats what I want to see? I am new to this and need step by step instructions, if I am going to teach myself.

    Is their a video where it shows you how to add the controls to a template?

    Matt
  2. Elliott
    Elliott avatar
    391 posts
    Member since:
    May 2010

    Posted 06 Jul 2012 Link to this post

    hey Dave
    when I use a template I just add the columns in markup
    <telerik:RadGrid ID="rgAddItems" AutoGenerateColumns="False" GridLines="Both" ShowFooter="true" runat="server">
        <MasterTableView DataKeyNames="PartNumberID" CommandItemDisplay="Bottom" NoDetailRecordsText="begin entering data" runat="server">
        <ItemStyle CssClass="grid_item_style" />
        <AlternatingItemStyle CssClass="grid_alternate_item_style" />
        <Columns>
            <telerik:GridBoundColumn UniqueName="PartNumberID" DataField="PartNumberID" Readonly="True" Visible="False"/>
            <telerik:GridTemplateColumn HeaderText="ItemID" Visible="False" >
                <ItemTemplate>
                    <asp:Label ID="lblItemID" Text='<%# Bind("ItemID") %>' runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="PartNumber" DataField="PartNumber" HeaderText="Part Number" ReadOnly="True" />
            <telerik:GridTemplateColumn HeaderText="Item Description">
                <ItemTemplate>
                    <asp:Label ID="lblItemDescription" Text='<%# Bind("Description") %>' runat="server" />
                </ItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridBoundColumn UniqueName="Qty" DataField="Qty" HeaderText="Quantity" />
            <telerik:GridEditCommandColumn EditText="Edit" />                    
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"/>    
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="ecColumn" />
            <FormTemplate>
                <table border="0" cellpadding="2" cellspacing="2">
                <tr>
                <td>
                    <asp:HiddenField ID="hdnPartNumberID" Value='<%# Bind("PartNumberID") %>' runat="server" />
                </td>
                <td>
                    <asp:HiddenField ID="hdnItemID" Value='<%# Bind("ItemID") %>' runat="server" />
                </td>
                </tr>
                <tr>
                <td class="body_text_black_BOLD">Part Number</td>
                <td>
                    <asp:TextBox ID="txtPartNumber" Text='<%# Bind("PartNumber") %>' CssClass="body_text_black" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="rfdPartNumber" ControlToValidate="txtPartNumber" ErrorMessage="Part Number Required" runat="server" />               
                </td>
                </tr>
                <tr>
                <td class="body_text_black_BOLD">Quantity</td>
                <td>
                    <telerik:RadNumericTextBox ID="rntbQty" Text='<%# Bind("Qty") %>' MaxLength="5" MaxValue="9999" MinValue="1" CssClass="body_text_black" runat="server" >
                        <NumberFormat DecimalDigits="0" />
                    </telerik:RadNumericTextBox>
                    <asp:RequiredFieldValidator ID="rfQty" ControlToValidate="rntbQty" ErrorMessage="Quantity required" runat="server">
                    </asp:RequiredFieldValidator>
                </td>
                </tr>
                <tr>
                <td>
                    <asp:LinkButton ID="btnUpdate" Text='<%# IIF(TryCast(Container,GridItem).OwnerTableView.IsItemInserted,"Insert","Update") %>'  CommandName='<%# IIF(TryCast(Container,GridItem).OwnerTableView.IsItemInserted,"PerformInsert","Update") %>' runat="server" />
                </td>
                <td>
                    <asp:LinkButton ID="btnCancel" Text="Cancel" CommandName="Cancel" CausesValidation="false" runat="server" />
                </td>
                </tr>
                </table>
            </FormTemplate>
        </EditFormSettings>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowDblClick="RowDblClick" />
        </ClientSettings>
        </telerik:RadGrid>

    note that templated columns have only an ItemTemplate
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top