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
Thomas Nielsne
NA
40
454
Make list global and accessible everywhere as datasource
Nov 8 2019 4:16 AM
Hello,
I have a class where I have a static list.
My challenge is, how to use the _list as datasource to a datagrid in a form?
Anyone that can help with howto do that?
Below is the class:
static class MyList
{
static List<InstalledServices> _list;
static MyList()
{
_list = new List<InstalledServices>();
}
public static void Add(string value, string value2, string value3)
{
_list.Add(new InstalledServices()
{
Service = value,
Name = value2,
Status = value3
});
}
public static void Show()
{
foreach (var value in _list)
{
Console.WriteLine(value);
}
}
class InstalledServices
{
public string Service { get; set; }
public string Name { get; set; }
public string Status { get; set; }
}
}
Reply
Answers (
2
)
How can I fill a Combobox in a datagridview from db mysql
draw a control contains label and control inside,in winForms