Get values of FormTemplate to EditFormSettings

2 posts, 0 answers
  1. Erick
    Erick avatar
    1 posts
    Member since:
    May 2019

    Posted 11 Jun 2019 Link to this post

    How is the best way to get values of controls to EditFormSettings ?

    I have this code but I don't know if there's other best way:


    protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
               if (e.CommandName == "PerformInsert")
                   GridEditFormInsertItem editform = (GridEditFormInsertItem)((Telerik.Web.UI.GridEditFormInsertItem)(e.Item));
                   RadTextBox txtbx = (RadTextBox)editform.FindControl("txtName");
                   string strtxt = txtbx.Text;
    <EditFormSettings EditFormType="Template">
               <telerik:RadLabel runat="server" Text="Name:" Font-Bold="True"></telerik:RadLabel>
               <br />
               <telerik:RadTextBox ID="txtName" runat="server" InputType="Text" MaxLength="70" Width="100%" AutoCompleteType="None" autocomplete="off"></telerik:RadTextBox>
               <asp:RequiredFieldValidator ErrorMessage="*" ControlToValidate="txtName" runat="server" CssClass="rfv" />
               <telerik:RadButton ID="btnSave" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Save" : "Update" %>'CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> </telerik:RadButton>


  2. Eyup
    Eyup avatar
    3901 posts

    Posted 14 Jun 2019 Link to this post

    Hello Erick,

    Yes, this approach is correct by general:

    You can also use the Bind expression in the mark-up code and then extract the values using ExtractValues method:

    I hope this will prove helpful.

    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top