[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


GRidview Add TEmplate columns programically with textboxes on the fly with a dataset asp.net vb

Posted on 2006-05-11
Medium Priority
Last Modified: 2012-05-05
I can make the template fields the way I want hard coded  Example below.

<asp:BoundField DataField="SPH" HeaderText=" Sphere" ReadOnly="True" SortExpression="SPH" />
                <asp:TemplateField HeaderText="0" SortExpression="c0">
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("c0") %>'></asp:TextBox>
                        <asp:TextBox ID="TextBox1" runat="server" Width="40px" Text='<%# Bind("c0") %>'></asp:TextBox>
                <asp:TemplateField HeaderText="-.25" SortExpression="c25">
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("c25") %>'></asp:TextBox>
                        <asp:TextBox ID="TextBox2" runat="server" Width="40px" Text='<%# Bind("c0") %>'></asp:TextBox>

But the problem is I need to do this on the fly with columns from my dataset as the number of colums change by the range of the product chosen.
Sometimes I have 7 colums other 15. The number of rows change to but that is not a problem.
Any help would be greatly appreciated.

Question by:astafate
1 Comment
LVL 25

Accepted Solution

nauman_ahmed earned 2000 total points
ID: 16660956
Dynamically loading an IBindableTemplate


Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month19 days, 10 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question