Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
VB.NET Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
C#
C# General Discussion
List<class> Help
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="tumatauenga, post: 4379, member: 9338"] uhm u've mostly everything u need [xcode=c#] /*sample data goes here*/ List<Part> partList = new List<Part>(); string[] header={"your","collection"}; int validCount = 0; string partTitle = "partTitle"; string partNumber = ""; string listPrice = "0.00"; string ourPrice = "1.00"; string partDesc = "some description"; string partImageLocation = "this should be a valid path, shouldn't it?"; partList.Add(new Part("Part #" + validCount.ToString() + " " + partTitle, partNumber, listPrice, ourPrice, partDesc, partImageLocation, header)); /* our costum class */ public class Part { public List<string> header = new List<string>(); //Properties public string Part_Title { get; set; } public string Part_Number { get; set; } public string List_Price { get; set; } public string Our_Price { get; set; } public string Prod_Desc { get; set; } public string Part_ImageLocation { get; set; } public string[] Header { get; set; } //Cunstructor with no arguments public Part() { Part_Title = "defaultTitle"; Part_Number = "defaultPartNumber"; List_Price = "0.00"; Our_Price = "0.00"; Prod_Desc = ""; Part_ImageLocation = ""; Header=new string[]{}; } //Constructor public Part(string parTitle, string partNumber, string listPrice, string ourPrice, string prodDesc, string part_imageLocation, string[] _header) { Part_Title = parTitle; Part_Number = partNumber; List_Price = listPrice; Our_Price = ourPrice; Prod_Desc = prodDesc; Part_ImageLocation = part_imageLocation; Header = _header; } public override string ToString() { return Part_Title + ", " + Part_Number + ", " + List_Price + ", " + Our_Price + ", " + Prod_Desc + ", " + Part_ImageLocation; } } [/xcode] [/QUOTE]
Insert quotes…
Verification
Post reply
C#
C# General Discussion
List<class> Help
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom