I have tried this function to implement the changes but the problem is since it is a itemdatabound it will make lot of round trips to set this behaviour which is equal to number of the rows created i guess. But this property has to be set at one time only. so is there a correct method or event that can make this thing happen with better performance rather than for each itemdatabound. Also how to make the pager visible always when there are items more than 10. now if i set it alwaysvisible = true then it displays the pager even there are no10 records. I am looking a way to make the pager visible always only after 10. then even the page set is 100 and the rows present are 14 the pager should be still availiable so that user doesn't have to refresh the pager to see the default pager settings again. Any help will be highly appreciated. Please.... protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) |
{ |
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", RadGrid1.MasterTableView.ClientID); |
PageSizeCombo.Items.Add(new RadComboBoxItem("50")); |
PageSizeCombo.FindItemByText("50").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID); |
PageSizeCombo.Items.Add(new RadComboBoxItem("150")); |
PageSizeCombo.FindItemByText("150").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID); |
PageSizeCombo.Items.Add(new RadComboBoxItem("250")); |
PageSizeCombo.FindItemByText("250").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID); |
PageSizeCombo.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = true; |
} |
} |