This question is locked. New answers and comments are not allowed.
Using Q1 2011 we would like to create a Telerik splitter control where the upper pane is filled with a Grid control.
If the user changes the height of the pane the grid should be adjusted, showing scrollbars _within_ the grid, if necessary.
Simplified code may be:
@{Html.Telerik().Splitter()
.Name("QueryResultSplitter")
.HtmlAttributes(new { style = "min-height: 800px; width: 100%;" })
.Orientation(SplitterOrientation.Vertical)
.Panes(panes =>
{
panes.Add()
.Collapsible(true)
.Size("50%")
.Content(
@<text>
@(Html.Telerik().Grid<QueryHit>()
.Name("QueryResultGrid")
.Columns(columns =>
columns.LoadSettings((IEnumerable<GridColumnSettings>)ViewData["Columns"]))
.Resizable(resizing => resizing.Columns(true))
.Scrollable(scrolling => scrolling
.Enabled(true)
.Height("auto"))
.HtmlAttributes(new { style = "height: 99%;" })
.Pageable(settings => settings.Total((int)ViewData["total"]).PageTo((int)ViewData["PageTo"]).PageSize((int)ViewData["PageSize"]))
.EnableCustomBinding(true)
.DataBinding(dataBinding => dataBinding.Ajax().Select("_QueryResult", "Query"))
.Selectable()
.ClientEvents(events => events.OnRowSelect("onRowSelect"))
.Sortable()
.Groupable()
)
</text>
);
panes.Add()
.Collapsible(true)
.Size("50%")
.LoadContentFrom("Index", "Document", new { id = "0_0" });
})
.Render();
}
The critical point here seems to be:
.Scrollable(scrolling => scrolling
.Enabled(true)
.Height("auto"))
I checked all possible versions for Height():
- "auto" will show all rows of the page and create a scrollbar for the splitter pane, if it's size gets too small, ending up in two vertical scrollbars (one scrollbar _within_ the grid, but disabled, and a second outside of the grid, working).
- A percent value will be related to the height of the splitter pane, what does not help here.
- A pixel value is not what we want.
What we need is something like .Height("adjust") just filling the remaining table place using the internal scrollbar if necessary.
Is there any solution for this?
Regards
Juergen
If the user changes the height of the pane the grid should be adjusted, showing scrollbars _within_ the grid, if necessary.
Simplified code may be:
@{Html.Telerik().Splitter()
.Name("QueryResultSplitter")
.HtmlAttributes(new { style = "min-height: 800px; width: 100%;" })
.Orientation(SplitterOrientation.Vertical)
.Panes(panes =>
{
panes.Add()
.Collapsible(true)
.Size("50%")
.Content(
@<text>
@(Html.Telerik().Grid<QueryHit>()
.Name("QueryResultGrid")
.Columns(columns =>
columns.LoadSettings((IEnumerable<GridColumnSettings>)ViewData["Columns"]))
.Resizable(resizing => resizing.Columns(true))
.Scrollable(scrolling => scrolling
.Enabled(true)
.Height("auto"))
.HtmlAttributes(new { style = "height: 99%;" })
.Pageable(settings => settings.Total((int)ViewData["total"]).PageTo((int)ViewData["PageTo"]).PageSize((int)ViewData["PageSize"]))
.EnableCustomBinding(true)
.DataBinding(dataBinding => dataBinding.Ajax().Select("_QueryResult", "Query"))
.Selectable()
.ClientEvents(events => events.OnRowSelect("onRowSelect"))
.Sortable()
.Groupable()
)
</text>
);
panes.Add()
.Collapsible(true)
.Size("50%")
.LoadContentFrom("Index", "Document", new { id = "0_0" });
})
.Render();
}
The critical point here seems to be:
.Scrollable(scrolling => scrolling
.Enabled(true)
.Height("auto"))
I checked all possible versions for Height():
- "auto" will show all rows of the page and create a scrollbar for the splitter pane, if it's size gets too small, ending up in two vertical scrollbars (one scrollbar _within_ the grid, but disabled, and a second outside of the grid, working).
- A percent value will be related to the height of the splitter pane, what does not help here.
- A pixel value is not what we want.
What we need is something like .Height("adjust") just filling the remaining table place using the internal scrollbar if necessary.
Is there any solution for this?
Regards
Juergen