This is a migrated thread and some comments may be shown as answers.

Set Scroll Height by PageSizeCombo selected

1 Answer 21 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rik butcher
Top achievements
Rank 1
rik butcher asked on 20 Dec 2014, 03:48 PM
guys, i'd like to be able to switch the ScrollHeight in the code behind based on the pageSize selected on the grid

we do this OnItemDataBound event and set the page size seletable to 15 & 30
if (e.Item is GridPagerItem)
{
RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
PageSizeCombo.Items.Clear();
PageSizeCombo.Items.Add(new RadComboBoxItem("15"));
PageSizeCombo.FindItemByText("15").Attributes.Add("ownerTableViewId", InventoriesRadGrid.MasterTableView.ClientID);
PageSizeCombo.Items.Add(new RadComboBoxItem("30"));
PageSizeCombo.FindItemByText("30").Attributes.Add("ownerTableViewId", InventoriesRadGrid.MasterTableView.ClientID);
PageSizeCombo.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
}

i've tried to punch into the events of the pagesizecombobox but it's not working - ANY IDEAS/ IM SURE IM MISSING SOMETHING SIMPLE
thanks
rik


protected void FixSize(object sender, GridPageSizeChangedEventArgs e)
{
RadComboBox PageSizeCombo = (RadComboBox)e.Item.FindControl("PageSizeComboBox");
if (PageSizeCombo.SelectedItem.Value == "15")
{
InventoriesRadGrid.ClientSettings.Scrolling.ScrollHeight = 610;
}
else
{
InventoriesRadGrid.ClientSettings.Scrolling.ScrollHeight = 1220;
}
}

1 Answer, 1 is accepted

Sort by
0
Konstantin Dikov
Telerik team
answered on 24 Dec 2014, 03:46 PM
Hello Rik,

You have another open tread regarding the same issue:
Please refer to the answer in the other thread.

On a side note, for both sides convenience, please try to avoid opening multiple threads for the same issue.


Best Regards,
Konstantin Dikov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
rik butcher
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question
or