Hello,
My requirement is lazy binding of the column layout. On click of any cell of a row or on click of the expansion indicator of row, I want to load the data for columnlayout in code behind and keep that row in expanded state. With the events - void dataGrid_CellClicked(object sender, Infragistics.Silverlight.CellClickedEventArgs e) { IsCellClicked = true; ActiveRow = (Row)e.Cell.Row; lstCurrentData = (List<ChildNode>)dataGrid.ItemsSource;
string strSelectedID = ((ChildNode)e.Cell.Row.Data).ID; List<ChildNode> lstChildren = new List<ChildNode>(); lstChildren = GetTheDataByParentID(strSelectedID); /* To get the children assign to respective node */ SearchRecursive(lstCurrentData, strSelectedID, lstChildren);
dataGrid.ItemsSource = null; dataGrid.ItemsSource = lstCurrentData; dataGrid.UpdateLayout(); }and void dataGrid_RowExpansionChanged(object sender, Infragistics.Silverlight.RowExpansionChangedEventArgs e) { List<ChildNode> vm = dataGrid.DataContext as List<ChildNode>; lstCurrentData = (List<ChildNode>)dataGrid.ItemsSource; string strSelectedID = ((ChildNode)e.Row.Data).ID; List<ChildNode> lstChildren = new List<ChildNode>(); lstChildren = GetTheDataByParentID(strSelectedID); SearchRecursive(lstCurrentData, strSelectedID, lstChildren); dataGrid.ItemsSource = null; dataGrid.ItemsSource = lstCurrentData; dataGrid.UpdateLayout(); }I get the data in ColumnLayout, but I need the respective row in expanded state. Now as the code in RowExpanded event is reassigning the ItemSource, its not allowing the row to expand on expander arrow click. But as I want to load the data for column layout at the time of expand, I've to do it in that event itself. Is there any other way for this? Please, help.Thanks,Pragati.
Hello Stefan,Thanks for your reply. I would like to mention one thing observed. As previously added about header alignment, when I click for expand, headers are not aligned properly. When I go for next level or even I click any cell of children row, it get aligned perfectly. For leaf node, I've set the margin & its showing the headers properly. ((XamGrid)sender).Margin = new Thickness(24, -5, -6, -5);Is there any such way? Please, check.Thanks,Pragati.
Hello Pragati,
I have been looking into the sample and I was able to reproduce the behavior you described and it seems to be expected since the XamGrid has a built-in UI virtualization, which cannot be turned off, so if you want I can log a product idea on your behalf, so you could be able to turn off the virtualization.
Looking forward for your reply.
Hello Stefan,I'm facing the issues while expanding the children rows & grids in that. As shown below,
1) The headers of child grid are not alligned properly.2) After expand and collapse all the levels, and again expanding one by one, it shows the blank space of previous expanded levels. Thanks,Pragati.
Hello Stefan, I got the solution for this one. I set IsAlternateRowsEnabled = false & it works. Another problem is, while scrolling vertically, the expanded rows get disturbed. Some get collapsed, some get hidden or unnecessary white space in child grid.Please, help.
Thank,Pragati.
Hello Stefan,Thanks for your reply. I've checked with the sample. But, still not applied in my application.I'm suffering another issue. I'm applying the styles in the event XamGrid_CellControlAttached. Surprisingly, the style for alternate rows is not getting applied. if (e.Cell.Row.Index % 2 == 0){ sValue = app.dictionary["IGForeCellStyle"];}else{ sValue = app.dictionary["IGAltForeCellStyle"];}Style - <Style x:Key="IGAltForeCellStyle" TargetType="igGrid:CellControl"> <Setter Property="FontSize" Value="11"></Setter> <Setter Property="Padding" Value="0,0,0,0"/> <Setter Property="Background" Value="#f0efb7"></Setter> </Style>Please, help. Thanks,Pragati.