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 Pragati,
I have modified the sample I sent you before, so now the horizontal scrollbars won’t appear, but you will be able to scroll horizontally with a mouse’s scroll button. Basically I handled the CellControlAttached event and set the ScrollBar’s Opacity to 0.
Hope this helps you.
Hello Stefan,As shown here, for the row details, I've skipped the headers, but the horizontal scrollbar is coming for every grid through heirarchy. 1) Can I hide these scrollbar as well and can handle the scrolling of all the child grids / expanded grids with that of outermost - main grid's scrollbar? As I'm having upto 20th - 25th level heirarchy, this may exceed upto 100 even, in such case its not good to see these much scrollbars there.2) Another point is, I'm going to indent the description as per the heirarchy, so with such heirarchy later the description of further items may get hidden due to column legth. Due to headers invisible, we cannot go for auto fit option - on double cilicking the headers edge. So, can we use the outermost grid's header click for this?Please, help.Thanks,Pragati.
Thanks Stefan for your quick reply.Pragati.
As I said in my previos post when you set the Height the XamGrid cannot resize itself anymore whn it is expanded and the child Rows won't be visible.
Hello Stefan,Thanks for your reply. Actually, my requirement is, I need the default height of all the rows in main grid and grid in datatemplate of row detail, to be 20. Is this possible?Thanks,Pragati.