Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

  • jon.borchardt

    jon.borchardt

    Member

    4 Points

    15 Posts

    Re: Hiding a Row in DataGrid

    Apr 21, 2011 06:17 PM | LINK

    This also works:

            private void datagrid_LoadingRow(object sender, DataGridRowEventArgs e)         {             if (((DataGrid)sender).ItemsSource != null)             {                 Binding newBinding = new Binding("IsMarkedForHide");                 newBinding.Mode = BindingMode.TwoWay;                 e.Row.SetBinding(DataGridRow.VisibilityProperty, newBinding);             }         }         private void datagrid_UnloadingRow(object sender, DataGridRowEventArgs e)         {             if (((DataGrid)sender).ItemsSource != null)             {                 e.Row.DataContext = null;             }         }