ASP.net 2015 Add TextBox Column to GridView for Data Entry

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I have a bound GridView that has a few template columns. I need to add an extra  template for data entry by the user.
It is to enter a numeric quantity. I tried markup like that below but "TextBox" was not recognized. While this may have worked
in previous versions of Visual Studio, it does not work inn 2015

<ItemTemplate>

<asp:TextBox ID="tbQty" runat="server" Width="25px"

MaxLength="3" />

</ItemTemplate>
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
Hi murbro,

Please paste the below code and let me know. It is working for me in  2015 visual studio.

        <asp:TemplateField HeaderText="Qty">
         <ItemTemplate>
             <asp:TextBox ID="tbQty" runat="server" Width="25px" MaxLength="3" />
         </ItemTemplate>
        </asp:TemplateField>

Open in new window

Regards,
Tapan Pattanaik
Murray BrownASP.net/VSTO Developer

Author

Commented:
Great answer. Thank you very much!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial