Please help! I have got a grid with two bands. When I click to expand a row the first time, the grid looks fine. Then when I click a second row to expand that row, it shows the vertical scroll bars and automatically scrolls all the way to the right. It doesn't matter which rows I click, it is always the second expansion that causes the scroll bar to appear.
ugPatients.DisplayLayout.Bands[0].Columns.FromKey("ColumnName").Width = System.Web.UI.WebControls.Unit.Percentage(10);)
and all the percentages for each band adds up to 100 percent. I tried having the percentage equal 80 and smaller, but this didn't help either. There is no reason why the vertical scrollbar should show. I have turned off the vertical scrollbar, but since it automatically scrolls to the right when expanding, it hides my plus signs that lets the user expand the row. Without the scroll bar at that point, a user can't expand the row since they can't scroll back to the beginning of the row.
This is driving me crazy!!! Any help is appreciated.
TIA,Rosemary
Have you set your Grid.DisplayLayout.ScrollBar = ScrollBar.Never ?
It has been a while...but I wanted to update on this issue. First to answer your question:
I did set it to never, which meant that when the expansion should have taken place and it didn't, it would cut off the left edge and I couldn't see or reach the parent row expansion node any longer.
Next to post the "solution".
What was happening is when I clicked on the child node, the scrollbars would "magically" appear even though there was plenty of room in the grid to view all the data.
The problem was that in code I had set the child node to 100%. When the child node was expanded and clicked, that 100% was expanding the row past the parent node which caused the whole view to move to the right and the scrollbars appear (or if I set it to never appear, it caused me to lose the ability to see the left side of the grid thus losing the ability to expand any other parent nodes).
My solution was to set the width of the child row smaller than the parent row since the child row is indented and doesn't have as much room as the parent. ie...if the parent row (band 0) is 400 pixels, I set the child row (band 1) to 350 pixels. Then I would set the width of each individual column based on the row width.
//Set the row widthGrid.DisplayLayout.Bands[1].RowStyle.Width = System.Web.UI.WebControls.Unit.Pixel(350);
//Set the column widthsGrid.DisplayLayout.Bands[1].Columns.FromKey("ColumnKey").Width = System.Web.UI.WebControls.Unit.Pixel(70);
Hope this makes sense! Rosemary