HI,
I have a rad grid. I would like to do the following validations.
1) When the user changes the dropdown value, i want to clear the other row items.
2) when the user does not input any data in the textbox (txtTestId)and tries to insert/edit, i want to provide validation.
Below is the UI of the radgrid:
How to achieve this?
Thanks
I have a rad grid. I would like to do the following validations.
1) When the user changes the dropdown value, i want to clear the other row items.
2) when the user does not input any data in the textbox (txtTestId)and tries to insert/edit, i want to provide validation.
Below is the UI of the radgrid:
<telerik:RadGrid ID="radgrid1" runat="server" OnDeleteCommand="radgrid1_DeleteCommand" OnInsertCommand="radgrid1_InsertCommand" OnUpdateCommand="radgrid1_UpdateCommand" OnNeedDataSource="radgrid1_NeedDataSource" OnPreRender="radgrid1_PreRender" CellSpacing="0" GridLines="None" ShowStatusBar="True" onitemdatabound="radgrid1_ItemDataBound" onitemcommand="radgrid1_ItemCommand"> <MasterTableView DataKeyNames="TestId" AutoGenerateColumns="false" EditMode="InPlace" CommandItemSettings-ShowRefreshButton="false" CommandItemDisplay="TopAndBottom" CommandItemSettings-AddNewRecordText="Add New"> <Columns> <telerik:GridEditCommandColumn ButtonType="ImageButton"> </telerik:GridEditCommandColumn> <telerik:GridButtonColumn ConfirmText="Delete?" ConfirmDialogType="RadWindow" ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" ConfirmDialogHeight="100px" ConfirmDialogWidth="220px"> </telerik:GridButtonColumn> <telerik:GridTemplateColumn HeaderText="Enter Id" DataField="TestName" UniqueName="TestName" Visible="true"> <ItemTemplate> <asp:TextBox ID="txtTestName" runat="server" ReadOnly="true" Text='<%# Eval("TestName") %>' /> <asp:TextBox ID="txtTestId" ReadOnly="true" runat="server" Text='<%# Eval("TestId") %>' Width="100px" /> </ItemTemplate> <InsertItemTemplate> <asp:DropDownList ID="ddlTestApp" runat="server"> <asp:ListItem Text="Java" Value="Java"></asp:ListItem> <asp:ListItem Text="UIDesign" Value="UIDesign"></asp:ListItem> </asp:DropDownList> <asp:TextBox ID="txtTestId" runat="server" Width="100px"></asp:TextBox> <asp:Button ID="btnInsertFetchData" runat="server" Text="Fetch Details" OnClick="btnInsertFetchData_Click" /> </InsertItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddlTestApp" runat="server" > <asp:ListItem Text="Java" Value="Java"></asp:ListItem> <asp:ListItem Text="UIDesign" Value="UIDesign"></asp:ListItem> </asp:DropDownList> <asp:TextBox ID="txtNetworkId" runat="server" Text='<%# Eval("TestId") %>' Width="100px"></asp:TextBox> <asp:Button ID="btnUpdateFetchData" runat="server" Text="Fetch Details" OnClick="btnUpdateFetchData_Click" /> </EditItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn DataField="FirstName" UniqueName="FirstName" Visible="true" HeaderText="First Name"> <InsertItemTemplate> <telerik:RadTextBox ID="RadtxtFirstName" runat="server" Text="" Width="100px"> </telerik:RadTextBox> </InsertItemTemplate> <EditItemTemplate> <telerik:RadTextBox ID="RadtxtFirstName" runat="server" Text='<%# Eval("FirstName") %>' Width="100px"> </telerik:RadTextBox> </EditItemTemplate> <ItemTemplate> <telerik:RadTextBox ID="RadtxtFirstName" ReadOnly="true" runat="server" Text='<%# Eval("FirstName") %>' Width="100px" /> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> <ClientSettings EnableRowHoverStyle="true"> </ClientSettings> </telerik:RadGrid>How to achieve this?
Thanks