Regarding query: For the datagrid I'm setting the ItemsSource myself, but I can't figure out programmatically how to tell the sfdatagrid that the feed is grouped. I believe I need a way to set the IsSourceGrouped flag on sfdatagrid similar to the xaml above.
We couldn’t get the scenario clearly. In SfDataGrid, we have a flag to check the datagrid is grouped or not. But you have mentioned that the sfdatagrid gets flag that feed is grouped or not. Please share it in more detail.
Please share your requirement clearly with us. Also please share the datacollection from view model. It would be helpful for us to provide a solution.
Regards,
Jayapradha
private void Sfdatagrid_Loaded(object sender, RoutedEventArgs e) { viewModel = this.sfdatagrid.DataContext as ViewModel; this.sfdatagrid.ItemsSource = viewModel.EmployeeDetails; this.sfdatagrid.Columns.Add(new GridTextColumn() { MappingName = "EmployeeID", CellTemplate = App.Current.Resources["cellTemplate"] as DataTemplate }); |
Is it possible to modify these lines from your example to bind at the A1.attValue level into the EmployeeID column?
this.sfdatagrid.ItemsSource = viewModel.EmployeeDetails;
this.sfdatagrid.Columns.Add(new GridTextColumn() { MappingName = "EmployeeID", CellTemplate=App.Current.Resources["cellTemplate"] as DataTemplate });
thanks again!
private void Sfgrid_Loaded(object sender, RoutedEventArgs e) { sfgrid.ItemsSource = viewModel.MyProperty; Binding disBinding = new Binding(); disBinding.Path = new PropertyPath("NameAttr.Name"); sfgrid.Columns.Add(new GridTextColumn() { MappingName = "CustomerName", DisplayBinding = disBinding, CellTemplate = App.Current.Resources["cellTemplate"] as DataTemplate }); |