TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
abdelwaheb ammar
1.3k
457
124.6k
create a List of list
Sep 14 2016 2:09 PM
Good evening everyone, I create a class named chien.cs with this code:
using
System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
namespace
formList
{
class
Chien
{
private
int
nombre;
public
int
chatte {
get
{
return
nombre; }
set
{ nombre = value; } }
public
Chien()
{
chatte = 3;
}
}
}
and then I create a custom control with this code:
using
System;
using
System.Collections.Generic;
using
System.ComponentModel;
using
System.Data;
using
System.Drawing;
using
System.Linq;
using
System.Text;
using
System.Windows.Forms;
namespace
formList
{
public
partial
class
CustomChien : Control
{
public
CustomChien()
{
InitializeComponent();
}
protected
override
void
OnPaint(PaintEventArgs pe)
{
base
.OnPaint(pe);
}
private
List<Chien> listchien =
new
List<Chien>();
public
List<Chien> ListItem
{
get
{
return
listchien; }
set
{
foreach
(Chien item
in
value)
{
listchien.Add(item);
}
}
}
}
}
and then during compiling it shows me this error that I do not understand that to mean.
Reply
Answers (
1
)
How can I add arraylist items in Datatable?
convert from c++ to c# code