Welcome to the Xceed Community Sign in | Join | Help
Community Search  

Re: dataviews in DataGrids

  •  04-18-2008, 9:16 AM

    Re: dataviews in DataGrids

    1-  you can do it this way:

    //if starting from a DataTable reference.
    myDataGridControl.ItemsSource = new DataGridCollectionView( myDataTable.DefaultView );

    //directly from a DataView
    myDataGridControl.ItemsSource = new DataGridCollectionView( myDataView );

    2- You can specify to the DataGridControl NOT to create its columns automatically based on the Data Source. This can be done by specifying myDataGridControl.AutoCreateColumns = false;

    From there, you can add columns manually to the DataGridControl.Columns collection.


    Marc Laroche
    Software Developer
    Xceed Software Inc.


    I don’t suffer from insanity, I enjoy every minute of it. - Unknown
View Complete Thread
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2008 Xceed Software Inc.