[Last Call] Learn how to a build a cloud-first strategyRegister Now


create gridview rows programmatically

Posted on 2006-05-17
Medium Priority
Last Modified: 2008-01-09
I want to add data to a gridview programmatically by looping through a collection. Something like:

        List<MyClass> object_list = bdb.GetSoundexNames(txtFirstName.Text, txtMiddleName.Text, txtLastName.Text);
        foreach (MyClass obj in object_list)
             // I want to create the columns Firstname, middlename and lastname

Can someone please help me with the syntax?

Should I create the columns programatically too? Or should I just add some html code in the aspx page?
Question by:IUAATech
LVL 33

Accepted Solution

raterus earned 800 total points
ID: 16703475
I'd highly recommend not doing this...It just is going to make your life much more difficult!

If you can do it in the HTML, do it, if you don't think you can do it, let me know why not and I'll see what I can't tell you so you can do it.

Author Comment

ID: 16703542
I think I can do it in the HTML. Will let u know if I have any trouble.

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Loops Section Overview
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

829 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