adding row dyanamicaly to gridview in WPF

Posted by user572914 on Stack Overflow See other posts from Stack Overflow or by user572914
Published on 2011-01-12T15:14:41Z Indexed on 2011/01/12 15:54 UTC
Read the original article Hit count: 320

Filed under:
|
|
|

Please help me with the following code,I want to add a row inputted by user to a gridview. I am able to add a row but its empty!!Please help.it worked in windows forms but its not working with WPF.

private void button1_Click(object sender, RoutedEventArgs e) { GetGridView(); } private void GetGridView() {

      string[] row0 = {textBox1.Text,"Beatles" };

            dataGrid1.Items.Add(row0); 
            dataGrid1.Columns[0].DisplayIndex = 0;
            dataGrid1.Columns[1].DisplayIndex = 1;

     }

////////////// sure,here it is

© Stack Overflow or respective owner

Related posts about c#

Related posts about wpf