Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27514

How do I add 3 textboxes in a GridView?

$
0
0
I have a gridview which gets first column description from the database table. However I want to add 3 more columns with texboxes for each row. Users will enter a number in any of the textboxes. They can leave a textbox blank if they want.
I have 34 rows. Each of the 34 rows have a description on the first column pulled from a database table. The 3 textboxes I want to add do not exist in the database table. Each row will have on first column a description, on second column a textbox on third column a text box and on fourth column a textbox. How do I do this?
I have attached an image of what i want my gridview to look like to the user.
Name:  GridView.JPG
Views: 22
Size:  31.9 KB
2

Code:

  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
  DataSourceID="SqlDataSource1" Width="957px">
    <Columns>
      <asp:BoundField DataField="hcs_Description" HeaderText="Medical Service Description"
        SortExpression="hcs_Description" />
      <asp:TemplateField HeaderText="You"></asp:TemplateField>
      <asp:TemplateField HeaderText="Spouse"></asp:TemplateField>
      <asp:TemplateField HeaderText="Child"></asp:TemplateField>
    </Columns>

  </asp:GridView>

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
  ConnectionString="<%$ ConnectionStrings:ConnectionString3 %>"
  ProviderName="<%$ ConnectionStrings:ConnectionString3.ProviderName %>"
  SelectCommand="  SELECT hcs_Description FROM [HealthCareEstimator].[hce].[HealthCareService]">
</asp:SqlDataSource>

Attached Images
 

Viewing all articles
Browse latest Browse all 27514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>