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"
>
<
FormTemplate
>
<
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
>
</
FormTemplate
>
</
EditFormSettings
>