Add TextBox to GridView

  • Thread starter Thread starter Gabriel
  • Start date Start date
G

Gabriel

Hello,

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

Thanks,
 
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,
 
Back
Top