I have a RadGrid that uses a GridTemplate column along with two Gridbutton columns called Edit and Delete and one link to ADD NEW RECORD.When I click on 'add new record' link to enter new record.In insert mode,treeview along with some textboxes get displayed with validation.What I want that onclick of Save button,it validate all textboxes along with treeview if it is enabled otherwise it should validate only textboxes.On 'PerformInsert' command ,I try to enable or disable that validator depending on the status of treeview.but it is not working.I try to change the Validation group also but still it is not working.
<telerik:RadGrid ID=
"radgridUserMgt"
GridLines=
"None"
runat=
"server"
AllowAutomaticDeletes=
"true"
AllowAutomaticInserts=
"false"
AllowAutomaticUpdates=
"false"
AllowSorting=
"true"
AutoGenerateColumns=
"false"
OnSortCommand=
"radgridUserMgt_SortCommand"
OnItemCommand=
"radgridUserMgt_ItemCommand"
>
<mastertableview commanditemdisplay=
"TopAndBottom"
datakeynames=
"UserID"
itemstyle-horizontalalign=
"Left"
alternatingitemstyle-horizontalalign=
"Left"
autogeneratecolumns=
"false"
editmode=
"EditForms"
insertitemdisplay=
"Top"
>
<ItemStyle Font-Size=
"11px"
/> <AlternatingItemStyle Font-Size=
"11px"
/>
<Columns> <telerik:GridTemplateColumn HeaderText=
"Email"
UniqueName=
"Email"
SortExpression=
"Email"
ColumnEditorID=
"EmailColumnEditor"
DataField=
"Email"
>
<ItemTemplate>
<asp:Label runat=
"server"
ID=
"lblEmail"
Text=
'<%# AntiXss.HtmlEncode(Eval("Email").ToString())%>'
></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox MaxLength=
"100"
runat=
"server"
ID=
"txtEmail"
Width=
"100px"
Text=
'<%# Bind("Email") %>'
></asp:TextBox><span
style=
"color: Red ;"
><asp:RequiredFieldValidator ID=
"valReqFieldEmail"
ControlToValidate=
"txtEmail"
ErrorMessage=
"*"
runat=
"server"
Width=
"10px"
ValidationGroup=
"ValidationGrp1"
> </asp:RequiredFieldValidator><br />
</EditItemTemplate> </telerik:GridTemplateColumn>
<telerik:GridTemplateColumn HeaderText=
"Business Email"
UniqueName=
"BusinessEmail"
SortExpression=
"BusinessEmail"
ColumnEditorID=
"BusinessEmailColumnEditor"
DataField=
"BusinessEmail"
ItemStyle-Width=
"10px"
> <ItemTemplate> <asp:Label runat=
"server"
ID=
"lblBusinessEmail"
Text=
'<%# AntiXss.HtmlEncode(Eval("BusinessEmail").ToString())%>'
></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:TextBox MaxLength=
"100"
runat=
"server"
ID=
"txtBusinessEmail"
Width=
"100px"
Text=
'<%# Bind("BusinessEmail") %>'
ValidationGroup=
"ValidationGrp1"
></asp:TextBox><span style=
"color: Red;"
><br />
</EditItemTemplate> </telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName=
"SelectPartner"
HeaderText=
"Select Partner"
Visible=
"false"
ColumnEditorID=
"SelectPartnerColumnEditor"
> <ItemTemplate> <asp:Label runat=
"server"
ID=
"lblSelectPartner"
Text=
"Select Partner"
></asp:Label>
</ItemTemplate> <EditItemTemplate> <span> <telerik:RadTreeView ID=
"radSelectPartner"
runat=
"server"
CheckBoxes=
"True"
Height=
"150px"
TriStateCheckBoxes=
"true"
CheckChildNodes=
"true"
OnLoad=
"radSelectPartner_Load"
ValidationGroup=
"ValidationGrp1"
>
</telerik:RadTreeView></span> <asp:RequiredFieldValidator ID=
"valReqFieldSelectPartner"
runat=
"server"
ErrorMessage=
"*"
ControlToValidate=
"radSelectPartner"
Width=
"10px"
ValidationGroup=
"ValidationGrp1"
EnableClientScript=
"true"
>
</asp:RequiredFieldValidator> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridButtonColumn HeaderText=
"Edit"
CommandName=
"Edit"
Text=
"Edit"
ItemStyle-HorizontalAlign=
"Center"
ButtonType=
"ImageButton"
UniqueName=
"EditCommandColumn"
ImageUrl=
"~/OneViewImages/edit.png"
> </telerik:GridButtonColumn>
<telerik:GridButtonColumn HeaderText=
"Delete"
ButtonType=
"ImageButton"
Text=
"Delete User"
UniqueName=
"DeleteColumn"
>
</telerik:GridButtonColumn> </Columns> <EditFormSettings ColumnNumber=
"3"
>
<FormMainTableStyle GridLines=
"None"
CellSpacing=
"0"
CellPadding=
"3"
BackColor=
"LightBlue"
Width=
"100%"
/> <FormTableStyle CellSpacing=
"0"
CellPadding=
"2"
Height=
"80px"
Width=
"100%"
BackColor=
"LightBlue"
/> <FormTableAlternatingItemStyle Wrap=
"False"
></FormTableAlternatingItemStyle>
<EditColumn ButtonType=
"ImageButton"
InsertText=
"Add User"
UpdateText=
"Update"
UniqueName=
"EditCommandColumn1"
CancelText=
"Cancel"
> </EditColumn> <FormTableButtonRowStyle HorizontalAlign=
"Right"
></FormTableButtonRowStyle>
</EditFormSettings> </mastertableview> <ValidationSettings CommandsToValidate=
"PerformInsert,Update"
ValidationGroup=
"ValidationGrp1"
/>
Any help will be appreciated.its urgent
Thanks