Click here to Skip to main content
15,893,266 members
Home / Discussions / C#
   

C#

 
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 
GeneralRe: Extracting numeric from string Pin
OriginalGriff25-Jan-11 1:09
mveOriginalGriff25-Jan-11 1:09 
AnswerRe: Extracting numeric from string Pin
musefan25-Jan-11 3:06
musefan25-Jan-11 3:06 
Questionjavascript: opener.document Pin
fififlowertot24-Jan-11 10:19
fififlowertot24-Jan-11 10:19 
AnswerRe: javascript: opener.document Pin
dan!sh 24-Jan-11 10:25
professional dan!sh 24-Jan-11 10:25 
GeneralRe: javascript: opener.document Pin
fififlowertot24-Jan-11 10:36
fififlowertot24-Jan-11 10:36 
GeneralRe: javascript: opener.document Pin
GenJerDan24-Jan-11 11:29
GenJerDan24-Jan-11 11:29 
GeneralRe: javascript: opener.document Pin
fififlowertot24-Jan-11 22:05
fififlowertot24-Jan-11 22:05 
QuestionHow do I access object properties using stack frames? Pin
DaleDaleM24-Jan-11 10:14
DaleDaleM24-Jan-11 10:14 

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.