473,395 Members | 1,568 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Add TextBox to GridView

Hello,

Is there a way to add a Textbox to a GridView ? I'd like one TextBox by
record.

Thanks,
Aug 20 '06 #1
3 11938
By "adding" a textbox, I assume you are referring to allow inserting of
records (i.e. an Add interface to a Gridview?) Or are you talking about
the fields that appear when you click Edit? Could you be more specific?

If this is for insert then these should help you,

http://geekswithblogs.net/casualjim/articles/51360.aspx

http://geekswithblogs.net/casualjim/.../04/77151.aspx

Gabriel wrote:
Hello,

Is there a way to add a Textbox to a GridView ? I'd like one TextBox by
record.

Thanks,
Aug 20 '06 #2
By "adding" a textbox, I assume you are referring to allow inserting of
records (i.e. an Add interface to a Gridview?) Or are you talking about
the fields that appear when you click Edit? Could you be more specific?
In fact for each record, I'd like add a TextBox. When I display the grid the
all textbox are empty, I add something in manually. I have a ButtonField to,
when I click on it in the event RowCommand, I'd like recover the value of
the textbox.

Add the Textbox ok :
<asp:TemplateField HeaderText="Qty">
<ItemTemplate>
<asp:TextBox ID="tbQty" runat="server" Width="25px"
MaxLength="3" />
</ItemTemplate>
<ItemStyle Width="25px" HorizontalAlign="Center"/>
</asp:TemplateField>

That's work, the last problem if recover the value from the RowCommand
event.

Thanks,


Aug 20 '06 #3
Gabriel,

To get to the textbox inside a Gridview, you need to use FindControl to
find the textbox inside a control and cast it to TextBox.

Hope this helps,

http://www.codeproject.com/dotnet/Ac...lsInsideGr.asp
Gabriel wrote:
By "adding" a textbox, I assume you are referring to allow inserting of
records (i.e. an Add interface to a Gridview?) Or are you talking about
the fields that appear when you click Edit? Could you be more specific?

In fact for each record, I'd like add a TextBox. When I display the grid the
all textbox are empty, I add something in manually. I have a ButtonField to,
when I click on it in the event RowCommand, I'd like recover the value of
the textbox.

Add the Textbox ok :
<asp:TemplateField HeaderText="Qty">
<ItemTemplate>
<asp:TextBox ID="tbQty" runat="server" Width="25px"
MaxLength="3" />
</ItemTemplate>
<ItemStyle Width="25px" HorizontalAlign="Center"/>
</asp:TemplateField>

That's work, the last problem if recover the value from the RowCommand
event.

Thanks,
Aug 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Nalaka | last post by:
Hi, I have a gridView (grid1), which as a templateColumn. In the template column, I have put in a gridView (grid2) and a ObjectDataSource (objectDataSource2). Question is... How to I pass the...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
0
by: ThePurpleCat | last post by:
Hi, I'm a newbie to ASP.NET programming but not to Visual Studio. I'm having trouble getting my Master-Details page to work. I have a page enabled GridView which is linked to a FormView control...
2
by: Dale | last post by:
This seems like it should be simple and I am pretty sure I've done similar things a hundred times before but I sure can't seem to get it right this time. I have a GridView with a column of text...
0
by: F | last post by:
Hi, The funniest part of the problem described here is that I am not new to ASP.NET, but honestly here I have no idea about what's going on. I have a GridView with a data source that just...
1
by: =?Utf-8?B?U2hhdw==?= | last post by:
I have a small GridView about max 10 rows and few columns. The columns are simple just a checkbox and a textbox and a bound name. The users don’t want to click “edit” button to edit and...
3
by: RobertTheProgrammer | last post by:
Hi folks, I've got another problem. Basically, I'm trying to use a nested GridView, however the nexted GridView displays no values (even though in debug I'm getting valid values into my DataSet. ...
4
by: Ken Fine | last post by:
I'm making an administrative interface that lists records in a GridView. For *each* row in the gridview, I would there to be two interface elements in addition to some information associated with...
13
by: SAL | last post by:
Hello, I'm trying to include a popup in the ItemTemplate of a gridview row. The ItemTemplate for the field contains a textbox and when the user clicks in the textbox I want a popup panel to show...
1
by: bala venkata siva ram kum | last post by:
hi friends, this is balu.while i am working with gridview i am facing this problem.this code is running successfully in gridview edit event.but when i used the same code in textboxtext changed...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.