Avatar of tmajor99
tmajor99
 asked on

C# Writing a LIST to Datagrid

Is it possible to write a LIST to a datagrid?  I have a LIST that contains a list of attribute names that I want to display in datagrid row. For example sortedList:
attributeTtitle
  Color
  Size
  Length

I want to list this to a datagrid or some type of table so that the is aligned horizontally like this:
Color    Size    Length

Currently, I am writing this LIST to an EXCEL record like beow:
var sortedList = FilteredValueOfProduct.OrderBy(prod => prod.attributeTtitle).ToList();

            foreach (var item in sortedList)
            {
                HttpContext.Current.Response.Write("<Td>");
                //Get column headers  and make it as bold in excel columns
                HttpContext.Current.Response.Write("<B>");
                HttpContext.Current.Response.Write(item.attributeTtitle.ToString());
                HttpContext.Current.Response.Write("</B>");
                HttpContext.Current.Response.Write("</Td>");
            }

Open in new window

C#.NET Programming

Avatar of undefined
Last Comment
Easwaran Paramasivam

8/22/2022 - Mon
SOLUTION
Fernando Soto

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Easwaran Paramasivam

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck