Click here to Skip to main content
15,886,632 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Everybody

Wishing you all a Happy n Prosperous New Year ..!

I have been trying to apply filtered textbox extender on a textbox control in nested Gridview's Footer Row since last 3 days but couldn't succeed.

The issue is that even after applying the FilterTextBoxExtender to the txtOutwardID textbox, it is not functioning as expected. I just want to allow numbers and "/-" characters in the textbox but it is allowing all the characters.

One more thing would like to mention that when I am applying the filter to the normal textbox in the form or in the main Gridview then it is working, but not in the child grid's footer row.

Please guide me where am I wrong.



here is my code

Thanks in Advance
Dinesh

ASP.NET
<asp:GridView ID="grdViewCustomers" runat="server" AutoGenerateColumns="false" DataKeyNames="PackerID" OnRowDataBound="grdViewCustomers_OnRowDataBound" CssClass="Grid">
   <Columns>
	<asp:TemplateField ItemStyle-Width="20px">
            <ItemTemplate>
		<a href="java<!-- no -->script:divexpandcollapse('div<%# Eval("PackerID") %>');">
		<img alt="Details" id="imgdiv<%# Eval("PackerID") %>" src="images/plus.png" />  </a>
		<div id="div<%# Eval("PackerID") %>" style="display: none;">
                   <asp:GridView ID="grdViewOrdersOfCustomer" runat="server"            AutoGenerateColumns="false" CssClass="ChildGrid" ShowFooter="true" OnRowCommand="grdViewOrdersOfCustomers_OnRowCommand">
			<Columns>
                            <asp:TemplateField HeaderText="OutwardID">
                                <ItemTemplate> 
                                    <asp:Label id="OutwardID" runat="server" Text='<%#Bind("OutwardID") %>'>
                                    </asp:Label>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox ID="txtOutwardID" runat="server" ></asp:TextBox>
                                    <act:FilteredTextBoxExtender  runat="server" ID="FteOutwardID" TargetControlID="txtOutwardID" FilterType="Custom" ValidChars="0123456789-/"></act:FilteredTextBoxExtender>
                                </FooterTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Date">
                                <ItemTemplate>
                                    <asp:Label id="Date" runat="server" Text='<%#Bind("Date") %>'>
                                    </asp:Label>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox runat="server" ID="txtDate" onfocus="setdate(this);" ></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="Product">
                                <ItemTemplate>
                                    <asp:Label id="ProductID" runat="server" Text='<%#Bind("ProductID") %>'>
                                    </asp:Label>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:TextBox ID="txtProductID" runat="server" ></asp:TextBox>
                                </FooterTemplate>
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="" >
                                <ItemTemplate>
                                </ItemTemplate>
                                <FooterTemplate>
                                    <asp:Button id="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" />
                                </FooterTemplate>
                            </asp:TemplateField>

                        </Columns>
	  	    </asp:GridView>
		</div>
	    </ItemTemplate>
	</asp:TemplateField>
	<asp:BoundField ItemStyle-Width="150px" DataField="Description" HeaderText="Contact Name" />
	<asp:BoundField ItemStyle-Width="150px" DataField="Location" HeaderText="City" />
     </Columns>
</asp:GridView>
Posted
Updated 2-Jan-14 18:03pm
v6
Comments
Naz_Firdouse 1-Jan-14 3:37am    
where you struck? what is the issue?
Dinesh Prajapati 1-Jan-14 4:41am    
I have improved my question and mentioned the issue face.
JoCodes 1-Jan-14 3:42am    
Issue faced???
Dinesh Prajapati 1-Jan-14 4:41am    
I have improved my question and mentioned the issue face.
Dinesh Prajapati 3-Jan-14 13:40pm    
I think there is no solution for this situation. Because I tried each n everything for FilteredTextBoxExtender to work on the Child Grid and Googled a lot for the same but in vain. And May be that's the reason that Here also nobody have come up with any guidance.
Anyway, Thanks a lot for everything

:)

1 solution

Have you tried to bind the filtered text box extender to your textbox in RowDataBound event?

Give it a shot!
 
Share this answer
 

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