Click here to Skip to main content
15,921,113 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
Estys25-Jan-11 2:17
Estys25-Jan-11 2:17 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
LAPEC25-Jan-11 2:19
LAPEC25-Jan-11 2:19 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
OriginalGriff25-Jan-11 2:25
mveOriginalGriff25-Jan-11 2:25 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
OriginalGriff25-Jan-11 2:22
mveOriginalGriff25-Jan-11 2:22 
GeneralRe: How to create a Module class in C# similar to VB .NET Pin
Estys25-Jan-11 2:01
Estys25-Jan-11 2:01 
AnswerRe: How to create a Module class in C# similar to VB .NET Pin
Pravin Patil, Mumbai25-Jan-11 1:41
Pravin Patil, Mumbai25-Jan-11 1:41 
QuestionTextbox Validation against IP Pin
Rei ho24-Jan-11 22:36
Rei ho24-Jan-11 22:36 
AnswerRe: Textbox Validation against IP Pin
OriginalGriff24-Jan-11 22:52
mveOriginalGriff24-Jan-11 22:52 
GeneralRe: Textbox Validation against IP Pin
Rei ho24-Jan-11 22:55
Rei ho24-Jan-11 22:55 
GeneralRe: Textbox Validation against IP Pin
OriginalGriff24-Jan-11 23:00
mveOriginalGriff24-Jan-11 23:00 
GeneralRe: Textbox Validation against IP Pin
Thomas Krojer24-Jan-11 23:11
Thomas Krojer24-Jan-11 23:11 
GeneralRe: Textbox Validation against IP Pin
OriginalGriff24-Jan-11 23:14
mveOriginalGriff24-Jan-11 23:14 
GeneralRe: Textbox Validation against IP Pin
Pete O'Hanlon24-Jan-11 23:49
mvePete O'Hanlon24-Jan-11 23:49 
GeneralRe: Textbox Validation against IP Pin
Rei ho25-Jan-11 14:43
Rei ho25-Jan-11 14:43 
GeneralRe: Textbox Validation against IP [SOLVED] Pin
Rei ho25-Jan-11 15:07
Rei ho25-Jan-11 15:07 
QuestionWPF DataGrid add rows and cells in runtime Pin
Mc_Topaz24-Jan-11 22:33
Mc_Topaz24-Jan-11 22:33 
I have a DataGrid created in XAML like this:
<DataGrid Name="gridPersons" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="390" Height="440" IsReadOnly="True">
    <DataGrid.Columns>
        <DataGridTextColumn Header="Name" Width="180"></DataGridTextColumn>
        <DataGridTextColumn Header="Age" Width="180"></DataGridTextColumn>
    </DataGrid.Columns> 
</DataGrid>


I also have a class to store data in:
class Person
{
    public string name;
    public int age;
    public string phoneNumber;

    public Person(string name, int age, string phoneNumber)
    {
        this.name = name;
        this.age = age;
        this.phoneNumber = phoneNumber;
    }
}


As well as populated a list to keep some data in:
static void Main(string[] args)
{
    List<Person> persons = new List<Person>();
    persons.Add(new Person("John", 25, "123456789");
    persons.Add(new Person("Tim", 20, "987654321");
}


Now I would like to foreach loop through the List<Person> into the DataGrid.
Each instance is a row in the grid and each row contains of only name and age property.

This was very easy in Windows Form Application, but in WPF I found this difficult Confused | :confused: Sigh | :sigh: Frown | :(
Any help?
QuestionLoading a video from a web server and displaying it on my application Pin
Rei ho24-Jan-11 20:30
Rei ho24-Jan-11 20:30 
AnswerRe: Loading a video from a web server and displaying it on my application Pin
RobCroll24-Jan-11 21:33
RobCroll24-Jan-11 21:33 
GeneralRe: Loading a video from a web server and displaying it on my application Pin
Rei ho24-Jan-11 22:40
Rei ho24-Jan-11 22:40 
GeneralRe: Loading a video from a web server and displaying it on my application Pin
RobCroll24-Jan-11 23:54
RobCroll24-Jan-11 23:54 
QuestionExtracting numeric from string Pin
nitin_ion24-Jan-11 20:23
nitin_ion24-Jan-11 20:23 
AnswerRe: Extracting numeric from string Pin
Pravin Patil, Mumbai24-Jan-11 21:32
Pravin Patil, Mumbai24-Jan-11 21:32 
GeneralRe: Extracting numeric from string Pin
OriginalGriff24-Jan-11 21:43
mveOriginalGriff24-Jan-11 21:43 
AnswerRe: Extracting numeric from string Pin
OriginalGriff24-Jan-11 21:41
mveOriginalGriff24-Jan-11 21:41 
GeneralRe: Extracting numeric from string Pin
Pravin Patil, Mumbai25-Jan-11 1:06
Pravin Patil, Mumbai25-Jan-11 1:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.