Hi there,
I have a Radgrid with server-side databinding and an onneeddatasource-event.
I want to change the pagesize dynamically in addiction to the mastertableview-size.
All looks good but when the TableView was updated with the new pagesize, i can't select the rows anymore...
The Script:
HTML-Code:
Code-Behind:
thanking you in anticipation
Best regards,
Markus
I have a Radgrid with server-side databinding and an onneeddatasource-event.
I want to change the pagesize dynamically in addiction to the mastertableview-size.
All looks good but when the TableView was updated with the new pagesize, i can't select the rows anymore...
The Script:
<
script
type
=
"text/javascript"
>
function GridCreated(sender, eventArgs) {
//gets the main table scrollArea HTLM element
var scrollArea = document.getElementById(sender.get_element().id + "_GridData");
var tvHeight = scrollArea.offsetHeight;
var size = Math.floor(tvHeight / 64);
//alert(size);
var tableView = $find("<%= RadGridView.ClientID %>").get_masterTableView();
tableView.set_pageSize(size);
}
</
script
>
HTML-Code:
<
telerik:RadGrid
ID
=
"RadGridView"
AutoGenerateColumns
=
"False"
onitemdatabound
=
"RadGridViewItemDataBound"
OnItemCreated
=
"RadGridViewItemCreated"
AllowSorting
=
"True"
AllowPaging
=
"True"
EnableViewState
=
"True"
OnPageIndexChanged
=
"RadGridPageIndexChanged"
OnNeedDataSource
=
"RadGridView_NeedDataSource"
runat
=
"server"
>
<
PagerStyle
Mode
=
"NextPrev"
Position
=
"Bottom"
AlwaysVisible
=
"True"
CssClass
=
"RadGridPager"
PagerTextFormat
=
"Seite blättern: {4} Seite {0} / {1} - Einträge {2} - {3} / {5}"
/>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
SaveScrollPosition
=
"true"
/>
<
ClientEvents
OnGridCreated
=
"GridCreated"
/>
</
ClientSettings
>
<
MasterTableView
TableLayout
=
"Fixed"
Font-Size
=
"18px"
ClientDataKeyNames
=
"IsBlueLight,IsFailure,IsStopped,OrderNr,ObjectNr"
DataKeyNames
=
"OrderNr"
>
<
NoRecordsTemplate
>
<
div
>
Keine Einträge
</
div
>
</
NoRecordsTemplate
>
<
Columns
>
.........
</
telerik:RadGrid
>
Code-Behind:
....
protected void RadGridView_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
RadGridView.DataSource = Session[Constants.ORDERLIST] as List<
Auftrag
>;
}
....
thanking you in anticipation
Best regards,
Markus