Rad Grid Edit Template

4 posts, 1 answers
  1. Sunny
    Sunny avatar
    26 posts
    Member since:
    Feb 2013

    Posted 04 Apr 2013 Link to this post

    Hello Sir/Madam,

    I am currently using  rad grid in my project and i am facing problem in Edit template as u can see in my first screen shot that i have attached named(Telerik_Rad_grid1) this is your design that i actully want in my project after click on edit button and here you are using bound controls and i am using template controls and using asp controls under edit template as u can see in my second screen shot of my grid named(Telerik_Rad_grid2) whats the design at run time so please tell me how can i make similar like your's design and i also have used all EditFormSetting But no result so please tell me asap.

    Thanks in advance
  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 04 Apr 2013 Link to this post

    Hello,

    Please use below property to achieve this thing.

    <EditFormSettings ColumnNumber="3" >


    <telerik:GridBoundColumn  EditFormColumnIndex="1">
                    </telerik:GridBoundColumn>


    Note : Please also check above property in below link.

    http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/multicolumneditform/defaultcs.aspx

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sunny
    Sunny avatar
    26 posts
    Member since:
    Feb 2013

    Posted 04 Apr 2013 Link to this post

    Hello Jayesh,

    As i told my above code i am not using
    <telerik:GridBoundColumn>
                    </telerik:GridBoundColumn>

    I m currnetily using Grid Template Column here is my code:

     <telerik:RadGrid ID="RadGrid_UnExpens" AllowSorting="true" OnNeedDataSource="RadGrid_UnExpens_NeedDataSource"
                    OnUpdateCommand="RadGrid_UnExpens_UpdateCommand" OnDeleteCommand="RadGrid_UnExpens_DeleteCommand" runat="server" AutoGenerateColumns="False">
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="375px" />
                    </ClientSettings>
                    <MasterTableView DataKeyNames="ID" AutoGenerateColumns="false">
                        <Columns>
                            <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                <HeaderStyle Width="50px" />
                            </telerik:GridEditCommandColumn>
                            <telerik:GridButtonColumn ConfirmText="Delete this Unestimated Expense?" ConfirmDialogType="RadWindow"
                                ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px"
                                ConfirmDialogWidth="220px">
                                <HeaderStyle Width="50px" />
                            </telerik:GridButtonColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Order Date" UniqueName="TemplateColumn1" EditFormColumnIndex="0" DataField="DateOrdered">
                                <ItemTemplate>
                                    <%# Eval("DateOrdered")%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_UnEstimateDateOrder" runat="server" Text='<%# Eval("DateOrdered")%>'></asp:TextBox>
                                    <asp:CalendarExtender ID="CalendarEx1" runat="server" TargetControlID="txt_UnEstimateDateOrder">
                                    </asp:CalendarExtender>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Required Date" UniqueName="TemplateColumn2" EditFormColumnIndex="0" DataField="DateRequired">
                                <ItemTemplate>
                                    <%# Eval("DateRequired")%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_UnEstimateDateRequired" runat="server" Text='<%# Eval("DateRequired")%>'></asp:TextBox>
                                    <asp:CalendarExtender ID="CalendarEx2" runat="server" TargetControlID="txt_UnEstimateDateRequired">
                                    </asp:CalendarExtender>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Company" UniqueName="TemplateColumn3">
                                <ItemTemplate>
                                    <%# Eval("CompanyName")%>
                                </ItemTemplate>
                                <HeaderStyle Width="200px" />
                                <EditItemTemplate>
                                    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:cnknoll %>"
                                        SelectCommand="select * from  v_EW_Vendors" runat="server"></asp:SqlDataSource>
                                    <telerik:RadComboBox ID="Combo_UnEstimateCompany" runat="server" ProviderName="System.Data.SqlClient"
                                        DataSourceID="SqlDataSource1" SelectedValue='<%# Eval("company_recid")%>' DataTextField="CompanyName"
                                        DataValueField="RecId">
                                    </telerik:RadComboBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Description" UniqueName="TemplateColumn4">
                                <ItemTemplate>
                                    <%# Eval("LineDesc")%>
                                </ItemTemplate>
                                <HeaderStyle Width="200px" />
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_UnEstimateLineDesc" runat="server" Text='<%# Eval("LineDesc")%>'></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="rfv_UnEstimateLineDesc" runat="server" CssClass="validation-error"
                                        SetFocusOnError="true" ControlToValidate="txt_UnEstimateLineDesc" ErrorMessage="Description Required"
                                        ForeColor="Red" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Quantity" UniqueName="TemplateColumn5">
                                <ItemTemplate>
                                    <%# String.Format("{0:n0}", Eval("LineQty"))%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_UnEstimateLineQty" runat="server" Text='<%# String.Format("{0:n0}", Eval("LineQty"))%>'></asp:TextBox>
                                   
                                    <asp:RequiredFieldValidator ID="rfv_UnEstimateLineQty" runat="server" CssClass="validation-error"
                                        SetFocusOnError="true" ControlToValidate="txt_UnEstimateLineQty" ErrorMessage="Quantity Required"
                                        ForeColor="Red" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Unit Price" UniqueName="TemplateColumn6">
                                <ItemTemplate>
                                    <%# String.Format("{0:C3}", Eval("UnitPrice"))%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_UnEstimateUnitPrice" runat="server" Text='<%# Eval("UnitPrice")%>'></asp:TextBox>
                                 
                                    <asp:RequiredFieldValidator ID="rfv_UnEstimateUnitPrice" runat="server" CssClass="validation-error"
                                        SetFocusOnError="true" ControlToValidate="txt_UnEstimateUnitPrice" ErrorMessage="Unit Price Required"
                                        ForeColor="Red" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="Total(USD)" UniqueName="TemplateColumn7">
                                <ItemTemplate>
                                    <%# String.Format("{0:C3}", Eval("Total_Price"))%>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Resizable="true" FilterControlAltText="Filter TemplateColumn1 column"
                                HeaderText="PO #" UniqueName="TemplateColumn8">
                                <ItemTemplate>
                                    <%# String.Format("{0:C3}", Eval("PO_Number"))%>
                                </ItemTemplate>
                                <ItemStyle Width="60px" />
                                <EditItemTemplate>
                                    <asp:TextBox ID="txt_UnEstimatePO_Number" runat="server" Text='<%# Eval("PO_Number")%>'></asp:TextBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <EditFormSettings ColumnNumber="2" CaptionDataField="ID">
                           
                           <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                   <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" Width="100%">
                    </FormMainTableStyle>
                    <FormTableStyle GridLines="Horizontal" CellSpacing="0" CellPadding="2" CssClass="module"
                        Height="110px" Width="100%"></FormTableStyle>
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
                            <%--<EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>--%>
                        </EditFormSettings>
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>

    So now tell me how can i acheive telerik pattern from my above code

    thanks in advance


  5. Answer
    Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 05 Apr 2013 Link to this post

    Hello,

    <MasterTableView DataKeyNames="ID" AutoGenerateColumns="false" EditMode="EditForms">
              <Columns>
                  <telerik:GridEditCommandColumn ButtonType="ImageButton">
                      <HeaderStyle Width="50px" />
                  </telerik:GridEditCommandColumn>
                  <telerik:GridButtonColumn ConfirmText="Delete this Unestimated Expense?" ConfirmDialogType="RadWindow"
                      ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px"
                      ConfirmDialogWidth="220px">
                      <HeaderStyle Width="50px" />
                  </telerik:GridButtonColumn>
                  <telerik:GridTemplateColumn EditFormColumnIndex="0">
                      <EditItemTemplate>
                          <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridTemplateColumn EditFormColumnIndex="1">
                      <EditItemTemplate>
                          <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridTemplateColumn EditFormColumnIndex="0">
                      <EditItemTemplate>
                          <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridTemplateColumn EditFormColumnIndex="1">
                      <EditItemTemplate>
                          <asp:TextBox ID="TextBox11" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridTemplateColumn EditFormColumnIndex="0">
                      <EditItemTemplate>
                          <asp:TextBox ID="TextBox22" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                  </telerik:GridTemplateColumn>
                  <telerik:GridTemplateColumn EditFormColumnIndex="1">
                      <EditItemTemplate>
                          <asp:TextBox ID="TextBox33" runat="server"></asp:TextBox>
                      </EditItemTemplate>
                  </telerik:GridTemplateColumn>
              </Columns>
              <EditFormSettings ColumnNumber="2" CaptionDataField="ID">
              </EditFormSettings>
          </MasterTableView>

     

    Thanks,
    Jayesh Goyani
Back to Top