Click here to Skip to main content
15,891,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How can i validate TextBox in nestedGridView.
I want to Validate the Child Grid, when i insert the records into child grid then i need to validate, if data is inserted in TextBox or not. if data is inserted then only data is added in grid.


can any one help me for this issue....
Posted
Updated 3-Oct-12 23:46pm
v2

1 solution

then what is problem ,use validation group property for footer control .
 
Share this answer
 
Comments
[no name] 4-Oct-12 3:15am    
no when i use the require field validator and validation group property , it's not working properly.
for ex in my parent grid i have 4 rows and child grid i want to validate the textbox means in my parent grid 4 rows also it's validating but i want to validate only selected row selected child grid textbox only.
solanki.net 4-Oct-12 3:21am    
because validation group is same for all .set different validation group name for child grid textbox and linkbutton .means it should same for these both control but it should not match with any other validation group name (mean unique)
[no name] 4-Oct-12 4:13am    
i want to check validation for child grid, here i'm passing validation group that should be unique for every row how to pass the unique value.
solanki.net 4-Oct-12 4:43am    
suppose your child grid has textbox and link button 'Add' in footer .then u should do like that :

<footertemplate>
<asp:TextBox ID="txtName" runat="server" ValidationGroup="ChildFooter" >
<asp:RequiredFieldValidator ID="rfvName" runat="server" ValidationGroup="ChildFooter" ErrorMessage="Enter Name" ControlToValidate="txtName" >


<footertemplate>

<asp:LinkButton ID="btnAdd" runat="server" CommandArgument='<%#Container.DataItemIndex %>' CommandName="AddChild" Text="Add" ValidationGroup="ChildFooter">
[no name] 4-Oct-12 5:45am    
i'm also do the same thing

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900