Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 9625 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET 4.0 > how to clear textbox which is in grid ...
Srinu0411

how to clear textbox which is in grid

Replies: 1 | Posted by: Srinu0411 on 3/4/2010 | Category: ASP.NET 4.0 Forums | Views: 1230 | Status: [Member]  


i have dropdownlist which contains options like(2,3,4)
gridview contains textbox
<asp:GridView ID="GrdOptions" runat="server" AutoGenerateColumns="False" Width="212px" >
<Columns>

<asp:TemplateField HeaderText="Option" HeaderStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:TextBox ID="txtText" runat="server" MaxLength="2000" Width="250px"></asp:TextBox>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Depending on dropdown options gridview will open
if ddlist is 2 then
gridview will open 2 textboxs


1)now how to clear textboxs in grid
2)ho to keep validation
if ddlist is 3, gridview will open 3 textboxs
if i fill 3 textboxs it is ok but if 0 or 1 or 2 it should show message in label or messagebox to fill all options

kaja srinivas


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Vuyiswamb
Vuyiswamb  
Posted on: 3/5/2010 9:27:13 AM
Level: NotApplicable | Status: [Member] [MVP] [Administrator]

i have few Questions for you.

When do you want to Clear the Textboxes ?

To Clear the Textbox you can iterate through the Grid and find the Controls and set their Text Property to an empty string.

When you say keep Validation am not sure what you mean, maybe you can elaborate on that part.


Thank you for posting at Dotnetfunda
[Administrator]

Srinu0411, if this helps please login to Mark As Answer. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/19/2013 4:51:02 PM