I have treeview control onclick on the child node I wand to populate the radGrid and it has a sorting functiolity.
OnClick of Node this method is called.
| public void PageSelectionChanged(long pageID) |
| { |
| ViewState["PageID"] = pageID; |
| radPageVersion.ReBind() |
| } |
I have on onNeedDataSource set. In needDataSource event I am calling a private method which calls Stores Proc with node ID as parameter. The problem is Node click event (PageSelectionChanged) is excecuted after NeedDataSource and rebind does not rebineds the grid and that is causing Node and and grid gets out of sync.
If I enableVeiwState it works fine on node click but when I click on header to sort does not work the grid gets empty NeedDatasource does not fires.
How can I make it work where I should be able to update grid onclick of some other controls and make sorting work?
Thanks
Imtiaz
<rad:RadEditor
Editable= "false"
HasPermission = "false"
ID="RadEditor1"
Width="600px"
Height="400px"
SaveInFile="True"
runat="server"
toolsfile="~/RadControls/Editor/ToolsFile.xml"
showhtmlmode="false"
showpreviewmode="true">
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" |
| EnableHistory="True" EnablePageHeadUpdate="False"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadAjaxManager1" /> |
| <telerik:AjaxUpdatedControl ControlID="ToolListing" /> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| function RowSelected(sender, eventArgs) { |
| var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); |
| ajaxManager.ajaxRequest('ROWSELECT:' + eventArgs.get_itemIndexHierarchical()); |
| } |
| </script> |
| </telerik:RadCodeBlock> |
| <telerik:RadAjaxPanel ID="PnlContent" runat="server" EnablePageHeadUpdate="False" EnableHistory="True"> |
| <telerik:RadToolBar ID="ToolListing" runat="server"> |
| </telerik:RadToolBar> |
| <telerik:RadGrid ID="AListingsGrid"> |
| <ClientSettings AllowKeyboardNavigation="True" EnableRowHoverStyle="True" EnablePostBackOnRowClick="False" |
| ClientEvents-OnRowSelected="RowSelected"> |
| <Selecting AllowRowSelect="True" /> |
| <Scrolling AllowScroll="True" UseStaticHeaders="True" /> |
| <Resizing AllowColumnResize="True" EnableRealTimeResize="True" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
| </telerik:RadAjaxPanel> |
| .RadMenu_ABMenu * |
| { |
| padding: 0; |
| } |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup |
| { |
| float: left; |
| height: 15px; |
| } |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup .rmItem |
| { |
| background: transparent url('Menu/BackgroundTab.gif') no-repeat; |
| } |
| .imgTab |
| { |
| width: 100%; |
| position: relative; |
| } |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup .rmFirst |
| { |
| /*background-position: -750px 0; |
| background: transparent url('Menu/BackgroundFirst.gif') no-repeat; |
| height: 15px; |
| width: 20px;*/ |
| } |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup .rmLast |
| { |
| /*background-position: 100% 0; |
| background: transparent url('Menu/BackgroundLast.gif') no-repeat; |
| height: 15px;*/ |
| } |
| .RadMenu_ABMenu .rmVertical.rmRootGroup |
| { |
| border: 1px solid #00FF00; |
| float: left; |
| padding: 0 5px; |
| } |
| /*Any item that links somewhere*/ |
| .RadMenu_ABMenu .rmLink |
| { |
| font: 11px/15px Arial,verdana,sans-serif; |
| margin: 3px 0; |
| color: #BB0000; |
| text-decoration: none; |
| } |
| .RadMenu_ABMenu .rmLeftImage |
| { |
| margin: 0 2px; |
| } |
| .RadMenu_ABMenu .rmText |
| { |
| margin: 0 0 0 13px; |
| padding: 0 13px 0 0; |
| } |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup .rmItem:hover |
| { |
| background: transparent url('Menu/BackgroundTab2.gif') no-repeat; |
| } |
| .RadMenu_ABMenu .rmLink:hover, |
| .RadMenu_ABMenu .rmExpanded, |
| .RadMenu_ABMenu .rmFocused |
| { |
| color: #fff; |
| border-bottom: solid 1px #fff; |
| } |
| .RadMenu_ABMenu .rmLink:hover .rmText, |
| .RadMenu_ABMenu .rmExpanded .rmText, |
| .RadMenu_ABMenu .rmFocused .rmText |
| { |
| /*background: #333;*/ |
| } |
| /* submenus */ |
| .RadMenu_ABMenu .rmRootGroup .rmGroup |
| { |
| background: transparent url('Common/inoxHeader.jpg') repeat 0 0; |
| } |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmItem |
| { |
| background: none; |
| padding: 1px 5px; |
| } |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmLink |
| { |
| line-height: 17px; |
| color: #0000DD; |
| } |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmLeftImage |
| { |
| margin: 0 3px; |
| } |
| /*Items below the RootGroup*/ |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmLink:hover, |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmExpanded, |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmFocused |
| { |
| color: #171717; |
| background: transparent url('Menu/separatorTab.gif') no-repeat; |
| background-position: 80px 0px; |
| } |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmLink:hover .rmText, |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmExpanded .rmText, |
| .RadMenu_ABMenu .rmRootGroup .rmGroup .rmFocused .rmText |
| { |
| background: transparent url('Menu/ItemBgLight.gif') no-repeat 100% 0; |
| } |
| /* separators */ |
| .RadMenu_ABMenu .rmVertical.rmRootGroup .rmItem.rmSeparator |
| { |
| background: #CCC; |
| height: 1px; |
| font-size: 0; |
| line-height: 0; |
| border-bottom: 3px solid #fff; |
| } |
| /*Affects any Item whose isSeparator field is set to true*/ |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup .rmItem.rmSeparator |
| { |
| background: transparent url('Menu/separatorTab.gif') no-repeat; |
| width: 45px; |
| height: 15px; |
| } |
| .RadMenu_ABMenu .rmHorizontal.rmRootGroup .rmVertical .rmItem.rmSeparator, |
| .RadMenu_ABMenu .rmVertical.rmRootGroup .rmVertical .rmItem.rmSeparator |
| { |
| padding: 0; |
| height: 1px; |
| margin-left: 5px; |
| border-bottom: 0; |
| } |
| /* disabled items */ |
| .RadMenu_ABMenu .rmDisabled, |
| .RadMenu_ABMenu .rmDisabled:hover |
| { |
| color: #666; |
| background: none; |
| } |
| .RadMenu_ABMenu .rmDisabled:hover .rmText |
| { |
| background: none; |
| } |
| .RadMenu_ABMenu .rmTopArrow, |
| .RadMenu_ABMenu .rmBottomArrow |
| { |
| height: 10px; |
| width: 100%; |
| background: #000 url(Menu/ArrowScrollUpDown.gif) no-repeat top center; |
| } |
| .RadMenu_ABMenu .rmBottomArrow |
| { |
| background-position: center -18px; |
| } |
| .RadMenu_ABMenu .rmLeftArrow, |
| .RadMenu_ABMenu .rmRightArrow |
| { |
| width: 10px; |
| height: 100%; |
| background: #000 url(Menu/ArrowScrollLeftRight.gif) no-repeat left center; |
| } |
| .RadMenu_ABMenu .rmRightArrow |
| { |
| background-position: -18px center; |
| } |