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

[Solved] Custom PageSizeComboBox in Hierarchy not firing

14 Answers 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David Kucharski
Top achievements
Rank 1
David Kucharski asked on 20 Jun 2013, 02:36 PM
I have a radgrid on my page that I create in the Page_Init. It has the MasterTableView along with a hierarchy setup call 'SubCodes'.

In my RadGrid1_ItemDataBound I am customizing the PageSizeComboBox for both the MasterTableView and SubCodes.
    Public Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name <> "SubCodes" Then
            Dim dropDown = DirectCast(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
            dropDown.Items.Clear()
            dropDown.Items.Add(New RadComboBoxItem("10"))
            dropDown.FindItemByText("10").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("20"))
            dropDown.FindItemByText("20").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("50"))
            dropDown.FindItemByText("50").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("100"))
            dropDown.FindItemByText("100").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True
        End If
 
        If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name = "SubCodes" Then
            Dim dropDown = DirectCast(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
            dropDown.Items.Clear()
            dropDown.Items.Add(New RadComboBoxItem("1"))
            dropDown.FindItemByText("1").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("2"))
            dropDown.FindItemByText("2").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("5"))
            dropDown.FindItemByText("5").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("10"))
            dropDown.FindItemByText("10").Attributes.Add("ownerTableViewId", e.Item.ClientID)
            dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True
        End If
end sub

The boxes for my MasterTableView and the DetailsTables come up with the correct entries. When I change the entry in one of my SubCodes DetailTables the system does not recall my RadGrid1_NeedDataSource and refresh the screen. It does if I change the entry in the MasterTableView. I believe it has something to do with assigning the ownerTableViewId to e.Item.ClientID for the SubCodes. What should I be doing. Below is the Page_Init function on how I create the radGrid.

RadGrid1.ID = "RadGrid1"
 RadGrid1.Width = Unit.Pixel(1500)
 RadGrid1.Height = Unit.Pixel(700)
 
 RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace
 RadGrid1.AllowPaging = True
 'RadGrid1.AllowCustomPaging = True
 RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
 RadGrid1.AutoGenerateColumns = False
 RadGrid1.ShowStatusBar = True
 RadGrid1.AllowSorting = True
 RadGrid1.AllowFilteringByColumn = True
 RadGrid1.MasterTableView.NoDetailRecordsText = "No records could be found."
 RadGrid1.MasterTableView.NoMasterRecordsText = "No records could be found."
 RadGrid1.MasterTableView.ShowHeadersWhenNoRecords = True
 
 RadGrid1.Skin = "WebBlue"
 RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "GetGridObject"
 RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2
 RadGrid1.ClientSettings.AllowColumnsReorder = True
 RadGrid1.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Swap
 RadGrid1.ClientSettings.Selecting.AllowRowSelect = True
 RadGrid1.ClientSettings.Resizing.AllowColumnResize = True
 RadGrid1.ClientSettings.Scrolling.AllowScroll = True
 RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True
 RadGrid1.ClientSettings.Scrolling.SaveScrollPosition = True
 RadGrid1.ClientSettings.ClientEvents.OnFilterMenuShowing = "filterMenuShowing"
 RadGrid1.FilterMenu.OnClientShowing = "MenuShowing"
 RadGrid1.MasterTableView.PageSize = 100
 
 If ConfigurationManager.AppSettings("geoSelectionGridSize") <> "" Then
     RadGrid1.MasterTableView.PageSize = ConfigurationManager.AppSettings("geoSelectionGridSize")
 Else
     RadGrid1.MasterTableView.PageSize = 50
 End If
 
 RadGrid1.MasterTableView.AllowMultiColumnSorting = True
 RadGrid1.MasterTableView.DataKeyNames = New String() {"DetailID", "Day", "FoundGeographies", "SubZipCount"}
 
 RadGrid1.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerOnDemand
 RadGrid1.MasterTableView.HierarchyDefaultExpanded = True
 
 Dim dpCounter As Integer = 1
 Dim dpCollection As IList(Of RadListBoxItem) = rlbDistributionPatterns.CheckedItems
 For Each item As RadListBoxItem In dpCollection
     Dim columnGroup As New GridColumnGroup
     columnGroup.HeaderText = item.Text
     columnGroup.Name = "GroupDP" & dpCounter.ToString
     columnGroup.HeaderStyle.HorizontalAlign = HorizontalAlign.Center
     RadGrid1.MasterTableView.ColumnGroups.Add(columnGroup)
     dpCounter += 1
 Next
 
 columnCreation("Geography", "Geography", RadGrid1)
 columnCreation("Circ Type", "CirculationTypeDescription", RadGrid1)
 columnCreation("Household", "HouseHold_Count", RadGrid1)
 columnCreation("Total Cov", "TotalCoverage", RadGrid1)
 
 If miZipCodeStoreAssociationTypeID > 0 Then
     columnCreation("Location Market", "LocationMarket", RadGrid1)
     columnCreation("Location Number", "LocationNumber", RadGrid1)
     columnCreation("Location Name", "LocationName", RadGrid1)
     columnCreation("Distance", "Distance", RadGrid1)
     columnCreation("Sales", "Sales", RadGrid1)
     columnCreation("Total Sales", "TotalSales", RadGrid1)
     columnCreation("BOS", "BOS", RadGrid1)
     columnCreation("Cume BOS", "CumeBOS", RadGrid1)
     columnCreation("SPH", "SPH", RadGrid1)
     columnCreation("SPH Index", "SPHIndex", RadGrid1)
 End If
 
 If mstrClientDataCategoryID1Description.Trim <> "" Then
     columnCreation(mstrClientDataCategoryID1Description.Trim, "CD1", RadGrid1)
 End If
 If mstrClientDataCategoryID2Description.Trim <> "" Then
     columnCreation(mstrClientDataCategoryID2Description.Trim, "CD2", RadGrid1)
 End If
 If mstrClientDataCategoryID3Description.Trim <> "" Then
     columnCreation(mstrClientDataCategoryID3Description.Trim, "CD3", RadGrid1)
 End If
 
 If mstrReportDemographicID1Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID1Description.Trim, "Demographic1", RadGrid1)
 End If
 If mstrReportDemographicID2Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID2Description.Trim, "Demographic2", RadGrid1)
 End If
 If mstrReportDemographicID3Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID3Description.Trim, "Demographic3", RadGrid1)
 End If
 If mstrReportDemographicID4Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID4Description.Trim, "Demographic4", RadGrid1)
 End If
 If mstrReportDemographicID5Description.Trim <> "" Then
     columnCreation(mstrReportDemographicID5Description.Trim, "Demographic5", RadGrid1)
 End If
 
 columnCreation("Day", "Day", RadGrid1)
 columnCreation("Selected", "Selected", RadGrid1)
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     columnCreation("Forced", "Forced", RadGrid1)
 End If
 columnCreation("Circ", "Circ", RadGrid1)
 columnCreation("Coverage", "Coverage", RadGrid1)
 
 columnCreation("Zones", "Zones", RadGrid1)
 
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     If miVersionsCategoryID > 0 Then
         columnCreation("Version", "Version", RadGrid1)
         columnCreation("Sub-Version Category", "SubVersionCategory", RadGrid1)
     End If
 
     If miDeliveryCodeCount > 0 Then
         columnCreation("Delivery Code", "DeliveryCode", RadGrid1)
     End If
 
     dpCounter = 1
     For Each item As RadListBoxItem In dpCollection
         columnCreation(item.Text, "DP" & dpCounter.ToString, RadGrid1)
         columnCreation(item.Text, "CoverageDP" & dpCounter.ToString, RadGrid1)
         dpCounter += 1
     Next
 End If
 
 columnCreation("FoundGeographies", "FoundGeographies", RadGrid1)
 
 Dim tableSubCode As New GridTableView(RadGrid1)
 tableSubCode.Name = "SubCodes"
 tableSubCode.DataKeyNames = New String() {"SubCodeID", "Day", "CirculationTypeDescription", "FoundGeographies"}
 tableSubCode.Width = Unit.Percentage(100)
 tableSubCode.AllowFilteringByColumn = False
 
 dpCounter = 1
 For Each item As RadListBoxItem In dpCollection
     Dim columnGroup As New GridColumnGroup
     columnGroup.HeaderText = item.Text
     columnGroup.Name = "GroupDP" & dpCounter.ToString
     columnGroup.HeaderStyle.HorizontalAlign = HorizontalAlign.Center
     tableSubCode.ColumnGroups.Add(columnGroup)
     dpCounter += 1
 Next
 
 Dim relationFields1 As GridRelationFields = New GridRelationFields()
 relationFields1.MasterKeyField = "DetailID"
 relationFields1.DetailKeyField = "DetailID"
 tableSubCode.ParentTableRelation.Add(relationFields1)
 RadGrid1.MasterTableView.DetailTables.Add(tableSubCode)
 
 columnSubCodeCreation("SubCode", "Sub_Code", tableSubCode)
 columnSubCodeCreation("Household", "HouseHold_Count", tableSubCode)
 
 If mstrClientDataCategoryID1Description.Trim <> "" Then
     columnSubCodeCreation(mstrClientDataCategoryID1Description.Trim, "CD1", tableSubCode)
 End If
 If mstrClientDataCategoryID2Description.Trim <> "" Then
     columnSubCodeCreation(mstrClientDataCategoryID2Description.Trim, "CD2", tableSubCode)
 End If
 If mstrClientDataCategoryID3Description.Trim <> "" Then
     columnSubCodeCreation(mstrClientDataCategoryID3Description.Trim, "CD3", tableSubCode)
 End If
 
 If mstrReportDemographicID1Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID1Description.Trim, "Demographic1", tableSubCode)
 End If
 If mstrReportDemographicID2Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID2Description.Trim, "Demographic2", tableSubCode)
 End If
 If mstrReportDemographicID3Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID3Description.Trim, "Demographic3", tableSubCode)
 End If
 If mstrReportDemographicID4Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID4Description.Trim, "Demographic4", tableSubCode)
 End If
 If mstrReportDemographicID5Description.Trim <> "" Then
     columnSubCodeCreation(mstrReportDemographicID5Description.Trim, "Demographic5", tableSubCode)
 End If
 
 columnSubCodeCreation("Selected", "Selected", tableSubCode)
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     columnSubCodeCreation("Forced", "Forced", tableSubCode)
 End If
 columnSubCodeCreation("Circ", "Circ", tableSubCode)
 columnSubCodeCreation("Coverage", "Coverage", tableSubCode)
 
 If UcHeader.objSession.ApplicationId <> CInt(ConfigurationManager.AppSettings("MediaviewerAppID")) Then
     dpCounter = 1
     For Each item As RadListBoxItem In dpCollection
         columnSubCodeCreation(item.Text, "DP" & dpCounter.ToString, tableSubCode)
         columnSubCodeCreation(item.Text, "CoverageDP" & dpCounter.ToString, tableSubCode)
         dpCounter += 1
     Next
 End If
 
 Me.PlaceHolder1.Controls.Add(RadGrid1)

14 Answers, 1 is accepted

Sort by
0
David Kucharski
Top achievements
Rank 1
answered on 20 Jun 2013, 07:14 PM
So I changed my code in the ItemDataBound to the following:

    Public Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name <> "SubCodes" Then
            Dim dropDown = DirectCast(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
            dropDown.Items.Clear()
            dropDown.Items.Add(New RadComboBoxItem("10"))
            dropDown.FindItemByText("10").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("20"))
            dropDown.FindItemByText("20").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("50"))
            dropDown.FindItemByText("50").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("100"))
            dropDown.FindItemByText("100").Attributes.Add("ownerTableViewId", RadGrid1.MasterTableView.ClientID)
            dropDown.FindItemByText(RadGrid1.MasterTableView.PageSize.ToString()).Selected = True
        End If
 
        If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name = "SubCodes" Then
            Dim dropDown = DirectCast(e.Item.FindControl("PageSizeComboBox"), RadComboBox)
            dropDown.Items.Clear()
            dropDown.Items.Add(New RadComboBoxItem("10"))
            dropDown.FindItemByText("10").Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("20"))
            dropDown.FindItemByText("20").Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("50"))
            dropDown.FindItemByText("50").Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID)
            dropDown.Items.Add(New RadComboBoxItem("100"))
            dropDown.FindItemByText("100").Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID)
            dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True
        End If
end sub

I changed in my SubCodes if to use e.Item.OwnerTableView.ClientID. This seems to fix my issue of a hierarchy level firing to the correct size. But it has brought up another error.

If my master table has a size of 50, 1 hierarchy level has the size of 20, another hierarchy level has the size of 100, I then change my master table view's size from 50 to 10, all levels, Master and all hierarchy levels change to 10 also. The hierarchy levels do not stay at 20 and 100 respectively.

Please let me know what I am doing wrong. Thanks
0
Pavlina
Telerik team
answered on 25 Jun 2013, 02:39 PM
Hello David,

To achieve your goal you can just set PageSizes property of RadGrid which is available since Q2 2012 release. The PageSizes property determines the values that will be displayed in the PageSize combo box in the RadGrid pager item. The default value of this property is int[] { 10,20,50 }.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Kucharski
Top achievements
Rank 1
answered on 25 Jun 2013, 02:49 PM
Pavlina,

Since I did not want the default PageSizes, I created my own and assigned them to the MasterTableView and DetailTables inside the ItemDataBound function. I found this from a telerik form also. And it works. Both Master and Child views have my new PageSizes. The problem is if I change one of my ChildTables to say a PageSize of 20, the screen refreshes, the Child Table is at 20 lines and the MasterTableView PageSize did not change. All good at this point. I then change my MasterTableView to say a PageSize of 100, the screen refreshes, the MasterTableView is set to 100, good, but all of the Child tables are also set to 100, bad.

Why would changing the MasterTableView PageSize effect the PageSize of the Child Tables. I think it has something to do with the following line: dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True and the system saying e.Item.OwnerTableView.PageSize is the MasterTableView. I need it to be the individual ChildTable's PageSize.
0
Pavlina
Telerik team
answered on 28 Jun 2013, 04:50 PM
Hello,

In my previous post I suggest you set custom page sizes values through PageSizes property of RadGrid, not the default ones. You can try with the code snippet below and let me know about the result:
<PagerStyle PageSizes="10,20,50,100,200"/>

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Kucharski
Top achievements
Rank 1
answered on 28 Jun 2013, 09:09 PM
Pavlina,

Thank you for the help. I cannot use your line
<PagerStyle PageSizes="10,20,50,100,200"/>

since I am creating the RadGrid in the Page_Init portion of my code behind page. When I try to set it in the Page_Init I am trying RadGrid1.MasterTableView.PagerStyle.PageSizes but I do not get the PageSizes property in the PagerStyle property. My Telerik Web UI version is 2012.2.815.40


Let me know if I am not looking in the correct area.
0
Pavlina
Telerik team
answered on 01 Jul 2013, 04:28 PM
Hello David,

Indeed PageSizes property of RadGrid is still not available in 2012.2.815 version of the controls. The property for defining the options for the ChangePageSize ComboBox in RadGrid pager is added in version Q3 2012. Please excuse me for the mistake.

To take advantage of PageSizes property you should upgrade the version of your Telerik controls to Q3 2012 or the latest one (Q2 2013). I am also attaching a sample project where you can see how it is working.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Kucharski
Top achievements
Rank 1
answered on 01 Jul 2013, 04:38 PM
Pavlina,

I will look into upgrading, but if that is not an option at this time, is there a work-around to the way I have implemented the Custom Page Sizes. I took this logic from previous posts and replies on this forum.

With the hierarchy part added on, is this a bug with the logic I am using? Is there a code work-around that I should be doing?

I still think the issue is when the user clicks on the mastertableview to change the pagesize, the ItemDataBound function gets called for the mastertableview and all DetailTables. When that happens, and I am in the If (TypeOf (e.Item) Is GridPagerItem) And e.Item.OwnerTableView.Name = "SubCodes" Then block for each DetailTable, I need to get the ownerid of the DetailTable. Instead of using the dropDown.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = True

e.Item.OwnerTableView.PageSize.ToString() is the MasterTableView instead of the DetailTable. Again, if I change the pageSize of an individual DetailTable all is good because e.Item.OwnerTableView.PageSize.ToString() is the DetailTable of the change.

Please let me know.
0
Pavlina
Telerik team
answered on 04 Jul 2013, 03:52 PM
Hi,

Go through the article below for more information how to identify the table to which the pager item belongs:
http://www.telerik.com/help/aspnet-ajax/grid-distinguish-rows-in-hierarchy-on-itemdatabound.html

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Kucharski
Top achievements
Rank 1
answered on 08 Jul 2013, 03:44 PM
Pavlina,

I am distinuguishing between MasterTableView and the GridTableView. When I choose to change a PageSize on one of the GridTableViews, the ItemDataBound only fires off for that GridTableView and changes the size. When I change the PageSize on the MasterTableView, the ItemDataBound fires for the MasterTableView and all of the GridTableView. At that point all of the GridTableView's go back to the default PageSize of 10 that was set up in the Page_Init portion. Remember I am creating this Grid through the Page_Init. It seems that the Grid is not hold the individual PageSize settings for all of the GridTableViews. Upon changing the PageSize of the MasterTableView, Sorting, Paginating to another page, the grid loses the settings for the GridTableViews and goes back to the default. How can I keep the settings of my GridTableViews when the user sorts, paginates, changes pagesize on the MasterTableView?
0
Pavlina
Telerik team
answered on 11 Jul 2013, 04:23 PM
Hello David,

The described behavior is expected. By default when you rebind a parent table in hierarchical grid the settings/expanded state for the nested tables will be lost. This is because the refresh action resets all previous settings applied for the nested controls to avoid ViewState inconsistencies/unexpected behavior.

However, you can refer to the code library below which shows how to retain expanded/selected state of hierarchy grid:
http://www.telerik.com/community/code-library/aspnet-ajax/grid/retain-expanded-selected-state-in-hierarchy-on-rebind.aspx

Give it a try and see if it works for you.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Kucharski
Top achievements
Rank 1
answered on 11 Jul 2013, 09:06 PM
I looked into the examples on your last post. In dealing with the change of Page Size, that does not fire the RadGrid1_ItemCommand but rather the RadGrid1_ItemDataBound.

Within that procedure the e.Item.ItemIndexHierarchical value is blank for everything so I cannot store that into any hashtables. Is there another procedure that will give me the unique identifier for each hierarchal table?

Also, when paginating the MasterTableView, since I am buiding the Grid in the code-behind, will the Hierarchal views have unique values through the entire dataset. What I mean is if on the 1st page there are 4 hierarchal view with indexes of (1,2,3,4) respectifully, when I paginate to page 2 on the MasterTableView and there are 4 new hierarchal views, those view will have different indexes than (1,2,3,4).

let me know.

thanks
0
Pavlina
Telerik team
answered on 12 Jul 2013, 12:38 PM
Hi David,

At this point I would recommend you again to upgrade to the latest version and take advantage of PageSizes property of RadGrid which is the best option for your scenario. Otherwise you should write your custom code solution depending on your needs.

Regards,
Pavlina
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
David Kucharski
Top achievements
Rank 1
answered on 15 Jul 2013, 03:15 PM
Pavlina,

Again, thank you for all of your help. Here is my last question.

If I upgrade and take advantage of the PageSizes property, will that solve the problem of when the MasterTableView is refreshed, all hierarchy tables will go back to their defaults? Since that is my main issue. I am able to customize the PageSize options for the MasterTableView and hierarchy, my problem is when I change the hierachy PageSize say from 10 to 20, then I refresh the MasterTableView (sort, paginate, filter) my PageSize for the hierarchy will go back to 10.

Better example of how I want the system to work:
Page 1: MasterTableView Page Size = 50, Hierarchy Table #1 Page Size changed to 20 (default was 10), Hierarchy Table #2 Page Size changed to 50 (default was 10)

I then go to Page 2 of MasterTableView. I then go back to Page 1 of MasterTableView.

Will Hierarchy Table #1 be at 10 or 20? Will Hierarchy Table #2 be at 10 or 50?

If using the PageSizes property will not fixe that issue, I don't believe upgrading will help at this time.

Please let me know.
0
Eyup
Telerik team
answered on 18 Jul 2013, 11:23 AM
Hello David,

As stated in the previous posts, when you rebind the main table, all of the inner tables are refreshed and their settings reset to default. Please note that this is a general behavior and you need to manually save the state of your detail tables before rebinding the master table in order to preserve their settings.

You can use State variable to persist the current settings:
http://msdn.microsoft.com/en-us/library/75x4ha6s%28v=vs.100%29.aspx

Alternatively, you can use RadPersistenceFramework for the inner tables:
http://www.telerik.com/help/aspnet-ajax/persistence-framework.html

Hope this helps.

Regards,
Eyup
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
David Kucharski
Top achievements
Rank 1
Answers by
David Kucharski
Top achievements
Rank 1
Pavlina
Telerik team
Eyup
Telerik team
Share this question
or