Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
145 views
Hello,
I am dinamically creating all controls on page_init. I have a RadGrid and RadFileExplorer added to its NestedViewTemplate. All works fine until I call Grid.Rebind method. I get the following exception:

Cannot unregister UpdatePanel with ID 'ajaxPanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel

I wasn't getting the exception until I defined a RadFileExplorer in the Grid's NestedViewTemplate. Is there any workaround that can enable this scenario?

Thank you in advance,
Vlada
Chi Hong
Top achievements
Rank 1
 answered on 16 Nov 2011
3 answers
106 views
I have a grid in a splitter pane. The splitter has width/height 100%. The grid has height/width set to 100%. The mastertableview has width="100%" and TableLayout="Fixed". In Firefox, everything works fine. The grid occupies 100% of the avalable space (vertically and horizontally and scrollbars are displayed if the grd content is too wide/tall. However, in IE 7, I have noticed the horizontal scrollbar is not shown and the vertical scrollbar is not visible because it is toof far off to the right. I added some code in the page load which checks for IE 7 and sets the grid width to 97% and this seems to work. However, 97% is only appropriate for a given screen size. For smaller screens, 97% would not be small enough to display the scrollbars, I would need to set it to something like 95%. So, its hard to get things to look right across different screen sizes. Is there a way to "resize" the grid on the client in an appropriate fashion when the page loads. I imagine this would include calculatig the width real-time of the splitter pane and setting the grid width accordingly. Can someone help me with this? Remember, I only want to do this if the browser is IE7/8.
Pavlina
Telerik team
 answered on 16 Nov 2011
2 answers
134 views
Hi,
I've deployed my website to a Windows Server 2008 R2 wiht IIS7 . The same website on my machine (windows 7 64bit) run perfectly.
My Web.Config is :

 <httpHandlers>
      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
      <add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>
      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>
      <add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>
    </httpHandlers>

<handlers>
      <remove name="ChartImage_axd"/>
      <remove name="Telerik_Web_UI_SpellCheckHandler_axd"/>
      <remove name="Telerik_Web_UI_DialogHandler_aspx"/>
      <remove name="Telerik_RadUploadProgressHandler_ashx"/>
      <remove name="Telerik_Web_UI_WebResource_axd"/>
      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode"/>
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode"/>
      <add name="Telerik_Web_UI_DialogHandler_aspx" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" preCondition="integratedMode"/>
      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode"/>
    </handlers>

I also added the application/x-axd to the mime types of the website just to make sure.
The ApplicationPool is running in integrated mode with the administration user.
After executing my page with a Grid e radajaxmanager i'm still getting an error related to the WebResource :

Webpage error details


User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Win64; x64; Trident/4.0; EasyBits GO v1.0; .NET CLR 2.0.50727; SLCC2; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Tablet PC 2.0; Media Center PC 6.0; .NET4.0C; .NET4.0E; InfoPath.3)
Timestamp: Wed, 9 Nov 2011 06:30:57 UTC

Message: Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500
Line: 6
Char: 84093
Code: 0
URI: http://88.81.190.60:8080/WebInfonet/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=RadScriptManager1_TSM&compress=1&_TSM_CombinedScripts_=%3b%3bSystem.Web.Extensions%2c+
Version%3d4.0.0.0%2c+Culture%3dneutral%2c+PublicKeyToken%3d31bf3856ad364e35%3aen-US%3a8f393b2b-3315-402f-b504-cd6d2db001f6%3aea597d4b%3ab25378d2%3bTelerik.Web.UI%2c
+Version%3d2011.2.915.40%2c+Culture%3dneutral%2c+PublicKeyToken%3d121fae78165ba3d4%3aen-US%3a9799c67b-558a-475d-bf30-a0ccf0dbb8b7%3a16e4e7cd%3aed16cbdc%3af7645509%3a24ee1bba%3af46195d3%3a1e771326%3a4cacbc31%3aaa288e2d%3ab7778d6c%3a7c926187%3a8674cba1%3ac08e9f8a%3aa51ee93e%3a59462f1%3a58366029

Any idea ?
Best Regards 
Alessandro 


Alessandro
Top achievements
Rank 1
 answered on 16 Nov 2011
0 answers
40 views
Hello All,

 I have scheduler which have calender for choosing the date as attached screen shot. I want that whenever user click on page calender will disappear. At that time it is disappear on highlighted button click.
Ranjan
Top achievements
Rank 1
 asked on 16 Nov 2011
3 answers
163 views
Hi ,

I have content-page is which i have radajax manager and radgrid,update panel  as  below.

when i delete ,copy first time using radajax request it works perfectly and  error comes in firefox

Error: uncaught exception: [Exception... "An invalid or illegal string was specified"  code: "12" nsresult: "0x8053000c (NS_ERROR_DOM_SYNTAX_ERR)"  location: "http://localhost/SQWebNET/ScriptResource.axd?d=gumzQ2oRMzwzsnNMMz4tEtfD3-F8Ve26kBpsS1IkM9ocQe4PE415WY-gfCZiuPQ30&t=7844759b Line: 292"]

then if i again try to delete  or copy i'll get error

Error: $find("ctl00_ContentPlaceHolder1_RadAjaxManager1") is null
Source File: http://localhost/SQWebNET/UserManagement/UserGroups.aspx
Line: 217

Please suggest solution for above.
Note: its working perfectly in othere browsers.

ASPX
<asp:Content ID="cntHead" runat="server" ContentPlaceHolderID="head">
    <link href="../CSS/style.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        div.RadToolBar .rtbItem
        {
            float: left !important;
        }
        .RadGrid .rgRow td, .RadGrid .rgAltRow td, .RadGrid .rgEditRow td, .RadGrid .rgFooter td
        {
            padding-top: 2px !important;
            padding-bottom: 2px !important;
        }
    </style>
    <script type="text/javascript" language="javascript">
        function onToolBarClientButtonClicking(sender, args) {
 
            var button = args.get_item();
 
            if (button.get_commandName() == getLabel('Delete')) {
                OpenConfirm();
            }
            else if (button.get_commandName() == getLabel('New')) {
 
                var oWnd = $find('ctl00_ContentPlaceHolder1_rdWUserGroup');
                oWnd.show();
                oWnd.setSize(470, 350);
                oWnd.SetTitle(getLabel('CreateNewGroup'));
                oWnd.setUrl('UserGroupPopUp.aspx?type=New');
                oWnd.center();
            }
            else if (button.get_commandName() == getLabel('NewAD')) {
 
                var oWnd = $find('ctl00_ContentPlaceHolder1_rdWUserGroup');
                oWnd.show();
                oWnd.setSize(470, 350);
                oWnd.SetTitle(getLabel('CreateNewGroup'));
                oWnd.setUrl('UserGroupPopUp.aspx?type=NewAD');
                oWnd.center();
            }
            else if (button.get_commandName() == getLabel('Edit')) {
                Edit('Button', 0);
            }
            else if (button.get_commandName() == getLabel('Copy')) {
                Copy('Button', 0);
            }
        }
 
        function Copy(control, rowIndex) {
            $find('ctl00_ContentPlaceHolder1_RadAjaxManager1').ajaxRequest("Copy");
        }
 
        function Edit(control, rowIndex) {
            //debugger;
            var radGrid = $find("ctl00_ContentPlaceHolder1_rgGroups");
            switch (control) {
 
                case 'Grid':
                    break;
                case 'Button':
                    if (radGrid.get_selectedItems()[0] != null) {
                        rowIndex = radGrid.get_selectedItems()[0]._itemIndexHierarchical;
                    }
                    else
                        rowIndex = '0';
                    break;
            }
            //document.getElementById('ctl00_ContentPlaceHolder1_hdnRowIndex').value = rowIndex;
            var MasterTable = radGrid.get_masterTableView();
 
            var GroupName = MasterTable.get_dataItems()[parseInt(rowIndex)].findElement("hdnGroupName").value;
            var safeGroupName = escape(GroupName);
            safeGroupName = safeGroupName.replace(/\+/g, '%2B');
            var GroupID = MasterTable.get_dataItems()[parseInt(rowIndex)].findElement("hdnGroupId").value;
            //var oWnd = $find("<%= rdWUserGroup.ClientID %>");
            var oWnd = $find('ctl00_ContentPlaceHolder1_rdWUserGroup');
            oWnd.show();
            oWnd.setSize(470, 350);
            oWnd.SetTitle(getLabel('EditGroup'));
            oWnd.center();
            oWnd.setUrl('UserGroupPopUp.aspx?type=Edit&GroupName=' + safeGroupName + '&GroupID=' + GroupID);
        }
 
        function OnClientClose(oWnd, args) {
 
            //debugger;
            //*  argument has 3 value when it Saves or Updates in Pop Up. It is returned on click of Cancel Button.Rebind Grid if arg is 3  *//
            arg = oWnd.argument;
            if (arg == "3" || arg == "2") {
                //document.getElementById('ctl00_ContentPlaceHolder1_btnBindUserGroups').click();
                $find("<%=RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
                oWnd.argument = "";
            }
            else {
                RowSelected(null);
                oWnd.argument = "";
            }
        }
 
        function RowSelected(rowObject) {
 
            var length = $find('ctl00_ContentPlaceHolder1_rgGroups').get_selectedItems().length;
            var radGrid = $get("ctl00_ContentPlaceHolder1_rgGroups");
            var radToolBar = $telerik.findControl(radGrid, "rtbGroups");
            var newButton = radToolBar.get_items().getItem(0);
            var newADButton = radToolBar.get_items().getItem(1);
            var deleteButton = radToolBar.get_items().getItem(2);
            var editButton = radToolBar.get_items().getItem(3);
            var copyButton = radToolBar.get_items().getItem(4);
            var hdnDomainCount = document.getElementById("ctl00_ContentPlaceHolder1_hdnDomainCount");
            switch (parseInt(length)) {
                case 0:
                    newButton.set_enabled(true);
                    if (hdnDomainCount.value != "0") {
                        newADButton.set_enabled(true);
                    }
                    deleteButton.set_enabled(false);
                    editButton.set_enabled(false);
                    copyButton.set_enabled(false);
                    break;
 
                case 1:
                    newButton.set_enabled(false);
                    newADButton.set_enabled(false);
                    deleteButton.set_enabled(true);
                    editButton.set_enabled(true);
                    copyButton.set_enabled(true);
                    break;
                case 2:
                    newButton.set_enabled(false);
                    newADButton.set_enabled(false);
                    deleteButton.set_enabled(true);
                    editButton.set_enabled(false);
                    copyButton.set_enabled(false);
                    break;
            }
        }
 
        function pageLoad() {
 
            var hdngrdPage = $get("<%= hdngridPaging.ClientID %>");
            if (hdngrdPage.value == 1) {
 
                $telerik.$('.rgPagePrev')[0].title = '';
                $telerik.$('.rgPageFirst')[0].title = '';
 
                $telerik.$('.rgPagePrev')[0].disabled = 'true';
                $telerik.$('.rgPageFirst')[0].disabled = 'true';
            }
            else if (hdngrdPage.value == 2) {
 
                $telerik.$('.rgPageNext')[0].title = '';
                $telerik.$('.rgPageLast')[0].title = '';
 
                $telerik.$('.rgPageNext')[0].disabled = 'true';
                $telerik.$('.rgPageLast')[0].disabled = 'true';
            }
            else if (hdngrdPage.value == 3) {
 
                $telerik.$('.rgPagePrev')[0].title = '';
                $telerik.$('.rgPageFirst')[0].title = '';
                $telerik.$('.rgPageNext')[0].title = '';
                $telerik.$('.rgPageLast')[0].title = '';
 
                $telerik.$('.rgPagePrev')[0].disabled = 'true';
                $telerik.$('.rgPageFirst')[0].disabled = 'true';
                $telerik.$('.rgPageNext')[0].disabled = 'true';
                $telerik.$('.rgPageLast')[0].disabled = 'true';
            }
 
            document.getElementById("ctl00_ContentPlaceHolder1_btnBindUserGroups").style.display = 'none';
            //document.getElementById("ctl00_ContentPlaceHolder1_btnDeleteUserGroups").style.display = 'none';
            var height = document.getElementById("ctl00_ContentPlaceHolder1_hdnHeight");
            //var pane = document.getElementById("ctl00_RightContenePane");
 
            document.getElementById("RAD_SPLITTER_PANE_CONTENT_ctl00_RightContenePane").style.height = height.value + "px";
            //            debugger;
            //            var radGrid = $find("ctl00_ContentPlaceHolder1_rgGroups");
            //            var MasterTable = radGrid.get_masterTableView();
            //pane.style.height = height.value + "px";
 
            var grid = $find("ctl00_ContentPlaceHolder1_rgGroups");
            var length = grid.get_masterTableView()._columnsInternal.length;
            for (i = 0; i < length - 1; i++) {
 
                var uniqueName = grid.get_masterTableView()._columnsInternal[i].get_uniqueName();
                getCookieGrid(i, uniqueName, grid);
            }
        }
 
        function ColumnResize(sender, args) {
            changeWidth(sender, args);
        }
 
        function OpenConfirm() {
            Telerik.Web.UI.RadWindowUtils.Localization["OK"] = getLabel("Yes"); //"Yes";
            Telerik.Web.UI.RadWindowUtils.Localization["Cancel"] = getLabel("No"); //"No";
            radconfirm(getLabel('DeleteConfirm'), confirmCallBackFn, 330, 100, null, getLabel("StarQueryWeb"));
            Telerik.Web.UI.RadWindowUtils.Localization["OK"] = getLabel("OK"); //"OK";
            Telerik.Web.UI.RadWindowUtils.Localization["Cancel"] = getLabel("CancelWindow"); //"Cancel";
            return false;
        }
 
        function confirmCallBackFn(arg) {
            if (arg) {
                //document.getElementById("ctl00_ContentPlaceHolder1_btnDeleteUserGroups").click();
                $find('ctl00_ContentPlaceHolder1_RadAjaxManager1').ajaxRequest("Delete");
            }
            else {
                return false;
            }
        }
 
        function BeforeCloseEditPage(radWindow, args) {
            //debugger;
            //alert("hi");
            if (radWindow.argument == "1") {
 
                 
                //*  argument has 1 value when it changes(text change ,Dropdown change) in Pop Up. It is returned on click of Close Button.Ask Confirmation if arg = 1.value is set in the respective change events(javascript)  *//
                args.set_cancel(true);
                var title = getLabel("StarQueryWeb");
                Telerik.Web.UI.RadWindowUtils.Localization["OK"] = getLabel("Yes"); //"Yes";
                Telerik.Web.UI.RadWindowUtils.Localization["Cancel"] = getLabel("No"); //"No";
 
                radconfirm(getLabel("SaveChanges"), confirmSaveChangesCallBackFn, 330, 100, null, title)
 
                Telerik.Web.UI.RadWindowUtils.Localization["OK"] = getLabel("OK"); //"OK";
                Telerik.Web.UI.RadWindowUtils.Localization["Cancel"] = getLabel("CancelWindow"); //"Cancel";
            }
            else {
                //*  argument has 2 value when it Updates(click on Save Button in Edit Mode) in Pop Up. Rebind the grid if arg = 2 value is set in validate()   *//
                if (radWindow.argument == "2") {
                    document.getElementById('ctl00_ContentPlaceHolder1_btnBindUserGroups').click();
                }
                else {
                    args.set_cancel(false);
                }
            }
        }
 
        function confirmSaveChangesCallBackFn(arg) {
            if (arg) {
 
                document.location.href = document.location.href;
            }
            else {
 
            }
        }
 
        function UserGroupsHelp(radWindow) {
            var TitleBar = radWindow.GetTitlebar();
            var parent = TitleBar.parentNode;
            var oUL = parent.getElementsByTagName('UL')[0];
            if (!(oUL.firstChild.id == "helpbuttonID")) // Check if the element is already added
            {
                // If not - create and add the custom button
                oUL.style.width = "50px";
                var oLI = document.createElement("LI");
                oLI.id = "helpbuttonID"
                var A = document.createElement("A");
                oLI.appendChild(A);
                A.className = "helpbutton";
                A.style.cursor = "hand";
                A.href = "javascript:void(0)";
                A.title = "Help";
                A.click = callBackFunction1;
                A.onmousedown = callBackFunction1;
                oUL.insertBefore(oLI, oUL.firstChild);
            }
        }
        function callBackFunction1() {
            var lnk = document.getElementById("ctl00_ContentPlaceHolder1_UserGroupPopUpHelpLnk");
            window.open(lnk.value);
            return false;
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server" EnablePageMethods="true"
        EnablePartialRendering="true">
    </asp:ToolkitScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgGroups"  LoadingPanelID="RadAjaxLoadingPanel1"/>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>
    <asp:UpdatePanel ID="uplGroups" runat="server" ChildrenAsTriggers="true" UpdateMode="Conditional"
        OnLoad="UpdatePanel_OnLoad">
        <ContentTemplate>
            <div id="rightside">
                <telerik:RadGrid ID="rgGroups" runat="server" AllowPaging="True" Width="100%" AllowMultiRowSelection="True"
                    GridLines="None" OnPageIndexChanged="rgGroups_PageIndexChanged"  OnItemCreated="rgGroups_ItemCreated"  OnItemDataBound="rgGroups_ItemDataBound"
                    OnNeedDataSource="rgGroups_NeedDataSource" AllowSorting="true" OnSortCommand="rgGroups_SortCommand"
                    OnPageSizeChanged="rgGroups_PageSizeChanged"
                    Culture="<%$ Resources:Culture %>">      <%--     OnItemEvent="rgGroups_ItemEvent"--%>
                    <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true" />
                    <ItemStyle Wrap="false" />
                    <HeaderStyle Wrap="false" />
                    <ClientSettings EnableRowHoverStyle="true" Resizing-AllowColumnResize="true" Resizing-EnableRealTimeResize="true">
                        <%--  <Scrolling AllowScroll="true"  UseStaticHeaders="true"  />--%>
                        <Selecting AllowRowSelect="true" />
                        <ClientEvents OnRowSelected="RowSelected" OnRowDeselected="RowSelected" OnColumnResized="ColumnResize"></ClientEvents>
                    </ClientSettings>
                    <SortingSettings EnableSkinSortStyles="false" />
                    <MasterTableView AutoGenerateColumns="false" CommandItemDisplay="Top" AllowNaturalSort="false">
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="GroupName" SortOrder="Ascending"></telerik:GridSortExpression>
                        </SortExpressions>
                        <CommandItemTemplate>
                            <telerik:RadToolBar ID="rtbGroups" runat="server" OnClientButtonClicked="onToolBarClientButtonClicking"
                                Height="26px" Width="100%">
                                <Items>
                                    <telerik:RadToolBarButton Text="<%$ Resources:New %>" CommandName="<%$ Resources:New %>"
                                        ImageUrl="~/Images/NewEnable2.png" Enabled='<%# rgGroups.EditIndexes.Count == 0 %>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:NewAD %>" CommandName="<%$ Resources:NewAD %>"
                                        ImageUrl="~/Images/NewEnable2.png" Enabled='<%# rgGroups.EditIndexes.Count == 0 %>' Value="NewAD">
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:Delete %>" CommandName="<%$ Resources:Delete %>"
                                        ImageUrl="~/Images/imgDelBtnEnable.png" Enabled='<%# rgGroups.EditIndexes.Count > 0 %>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:Edit %>" CommandName="<%$ Resources:Edit %>"
                                        ImageUrl="~/Images/imgEditBtnEnable.png" Enabled='<%# rgGroups.EditIndexes.Count > 0 && rgGroups.EditIndexes.Count == 1%>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton Text="<%$ Resources:Copy %>" CommandName="<%$ Resources:Copy %>"
                                        ImageUrl="~/Images/imgCopyBtnEnable.png" Enabled='<%# rgGroups.EditIndexes.Count > 0 && rgGroups.EditIndexes.Count == 1%>'>
                                    </telerik:RadToolBarButton>
                                    <telerik:RadToolBarButton CssClass="rightAligned">
                                        <ItemTemplate>
                                            <table style="background-color: White;" cellpadding="0" cellspacing="0">
                                                <tr>
                                                    <td valign="middle" style="width: 20px;" align="center">
                                                        <asp:Image ID="imgSearch" runat="server" ImageUrl="~/Images/Search-icon3.png" />
                                                    </td>
                                                    <td>
                                                        <telerik:RadTextBox ID="txtsearchusers" runat="server" AutoPostBack="true" MaxLength="20"
                                                            OnTextChanged="txtsearchusers_TextChanged" EmptyMessage="<%$ Resources:EnterToSearch %>"
                                                            Width="200px" CssClass="txtSearch">
                                                        </telerik:RadTextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </telerik:RadToolBarButton>
                                </Items>
                            </telerik:RadToolBar>
                        </CommandItemTemplate>
                        <Columns>
                            <telerik:GridClientSelectColumn  HeaderStyle-Width="35px"
                                ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" Resizable="false">
                            </telerik:GridClientSelectColumn>
                            <telerik:GridTemplateColumn UniqueName="GroupName" HeaderText="<%$ Resources:GroupName%>"
                                ItemStyle-Width="25%" HeaderStyle-Width="25%" FooterStyle-Width="25%" SortExpression="GroupName"
                                ShowSortIcon="true">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkGroupName" runat="server" Text='<%# Eval("GroupName") %>'
                                        Font-Underline="true"></asp:LinkButton>
                                    <asp:HiddenField ID="hdnGroupName" runat="server" Value='<%# Eval("GroupName") %>' />
                                </ItemTemplate>
                                <ItemStyle Wrap="false" />
                                <HeaderStyle Wrap="false" />
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="GroupType" HeaderText="<%$ Resources:GroupType %>"
                                UniqueName="GroupType" HeaderStyle-Width="88px"
                                  HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                                <ItemStyle Wrap="false" />
                                <HeaderStyle Wrap="false" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Description" HeaderText="<%$ Resources:Description %>"
                                UniqueName="Description"  ItemStyle-Width="25%" >
                                <ItemStyle Wrap="false" />
                                <HeaderStyle Wrap="false" />
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="<%$ Resources:UsersinGroup%>" UniqueName="UsersInGroup" HeaderStyle-HorizontalAlign="Left" Resizable="false">
                                <ItemTemplate>
                                    <asp:Label ID="lblUsersinGroup" runat="server"></asp:Label>
                                    <telerik:RadToolTip ID="rtooltipUsersinGroup" runat="server" TargetControlID="lblUsersinGroup"
                                        RelativeTo="Element" Position="BottomCenter" EnableShadow="true" Height="30px"
                                        Width="120px">
                                    </telerik:RadToolTip>
                                    <asp:HiddenField ID="hdnGroupId" runat="server" Value='<%#Eval("GroupId")%>' />
                                </ItemTemplate>
                                <ItemStyle Wrap="false" />
                                <HeaderStyle Wrap="false" />
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
                
            </div>
            <script type="text/javascript">
                removeClass('ctl00_ContentPlaceHolder1_rgGroups_ctl00_ctl02_ctl00_rtbGroups');
            </script>
            <asp:Label ID="lblSearchText" runat="server" Visible="false"></asp:Label>
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="btnBindUserGroups" EventName="Click" />
            <%--<asp:AsyncPostBackTrigger ControlID="btnDeleteUserGroups" EventName="Click" />--%>
        </Triggers>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="upHeight" runat="server">
        <ContentTemplate>
            <asp:HiddenField ID="hdngridPaging" runat="server" />
            <asp:HiddenField ID="hdnHeight" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
       <asp:HiddenField ID="hdnDomainCount" runat="server" />
    <asp:HiddenField ID="hdnRowIndex" runat="server" />
    <asp:HiddenField ID="hdnEditGroupId" runat="server" />
    <asp:HiddenField ID="UserGroupPopUpHelpLnk" runat="server" Value="<%$ Resources:UserGroupPopUpHelpPath %>" />
    <asp:Button ID="btnBindUserGroups" runat="server" OnClick="btnBindUserGroups_Click" />
    <%--<asp:Button ID="btnDeleteUserGroups" runat="server" OnClick="btnDeleteUserGroups_Click"/>--%>
    <script type="text/javascript" language="javascript">
        Telerik.Web.UI.RadWindowUtils.Localization =
        {
            "Close": getLabel("CloseWindow"),
            "OK": getLabel("OK"),
            "Cancel": getLabel("CancelWindow")
        }; 
    </script>
    <telerik:RadWindowManager ID="rdWMUserGroup" runat="server" VisibleOnPageLoad="false"
        KeepInScreenBounds="true" Modal="true" OnClientClose="OnClientClose" VisibleStatusbar="false"
        ShowContentDuringLoad="false">
        <Windows>
            <telerik:RadWindow runat="server" ID="rdWUserGroup" AutoSize="true" Behaviors="Move,Close,Resize"
                OnClientBeforeClose="BeforeCloseEditPage" OnClientShow="UserGroupsHelp" ReloadOnShow="true"
                IconUrl="../Images/userPerm.png">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
</asp:Content>

cs
public partial class UserGroups : SQWebBasePage
  {
      int TotalItemCount = 0;
      static string sWebUrl = string.Empty;
 
      protected void Page_Load(object sender, EventArgs e)
      {
          AuthenticateUser();
          init_js_culture_label();
          sWebUrl = init_getActiveDirectoryXmlFilePath();
 
          if (!IsPostBack)
          {
              List<ADProviderKeys> lstADProvider = ADProviderSettings.GetADProviderList();
              hdnDomainCount.Value = lstADProvider.Count.ToString();
 
              ViewState["PageLoad"] = "1";
              SQWUser objUser = SQWUserList.GetByName(Session["UserName"].ToString());
              string pageSize =GetPageSize(objUser, "UserGroups");
              if (pageSize == "All") // To show all records in the grid
              {
                  pageSize = GetTotalRecords();       
              }
              rgGroups.PageSize = pageSize == "0" ? 10 : Convert.ToInt32(pageSize);               
              BindGrid();
              ViewState["PageLoad"] = "";
              objUser = null;
  
          }
          Label lblPageTitle = (Label)Master.FindControl("MainSplitter").FindControl("RightContenePane").FindControl("lblPageTitle");
          lblPageTitle.Text = (string)GetLocalResourceObject("Title");
          // This code is to access the help file according to current content page.
          HiddenField helplnk = (HiddenField)Page.Master.FindControl("HelpLink");
          helplnk.Value = getLocalRessourceObjectForJS("UserGroupsHelpPath").ToString();
          SQWebNET.MasterPages.MasterPage oMasterPage = (SQWebNET.MasterPages.MasterPage)Page.Master;
          oMasterPage.PageName = "UserGroups";
      }
 
      #region This Method will be autheticated on every PageLoad to check the Session
      protected void AuthenticateUser()
      {
 
          if (Session["UserName"] == null || Convert.ToString(Session["UserName"]) == string.Empty)
          {
              Response.Redirect("~/Security/LoginPage.aspx");
          }
 
          if (Convert.ToString(Session["LoggedInAs"]) == "" || Convert.ToString(Session["LoggedInAs"]) == "ReportManager")
          {
              Server.Transfer("~/Security/Error.aspx?code=page");
          }
      }
 
      #endregion
 
      //protected void txtsearchusers_TextChanged(object sender, EventArgs e)
      //{
      //    BindGrid();
      //}
 
      public void BindGrid()
      {        
          string sFilter = lblSearchText.Text.ToString().Trim();      
          if (sFilter != string.Empty)
          {
              rgGroups.DataSource = SQWebNetClasses.SQWUserGroupList.SearchByName(sFilter);               
          }
          else
          {
              rgGroups.DataSource = SQWebNetClasses.SQWUserGroupList.GetGroupList();               
          }
          rgGroups.DataBind();
          if (Convert.ToString(ViewState["PageLoad"]) != "1" || rgGroups.PageSize == 10)
          {
              SetHeightGrid(rgGroups.PageSize);
          }
      }
 
      protected void SetHeightGrid(int pageSize)
      {
           
          SQWUser objUser = SQWUserList.GetByName(Session["UserName"].ToString());
          string oPagesize = GetPageSize(objUser, "UserGroups");//SQWUserList.GetPageSize(objUser, "UserGroups");
          string sFilter = lblSearchText.Text.Trim();
          int gridTotalCount = Convert.ToInt32(GetTotalRecords());
          if (oPagesize == "All")
          {
              pageSize = gridTotalCount;
          }           
 
          int heightToolbar = 35;
          int footer = 40;
          int gridHeight = (gridTotalCount < pageSize) ? (gridTotalCount * 25) : (pageSize * 25);
          gridHeight = gridHeight + heightToolbar + 30 + footer;
          hdnHeight.Value = gridHeight.ToString();
          objUser = null;         
 
      }
 
      //protected void rgGroups_ItemEvent(object sender, GridItemEventArgs e)
      //{
      //    if (e.EventInfo is GridInitializePagerItem)
      //    {
      //        TotalItemCount = (e.EventInfo as GridInitializePagerItem).PagingManager.DataSourceCount;
      //    }
      //}
      protected void rgGroups_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
      {
          if (e.Item is GridDataItem)
          {
              GridDataItem item = (GridDataItem)e.Item;
              TableCell cellGroupName = item["GroupName"];
              LinkButton lnkGroupName = (LinkButton)cellGroupName.FindControl("lnkGroupName");
              lnkGroupName.Attributes.Add("onclick", "return Edit('Grid','" + e.Item.ItemIndex.ToString() + "');");
 
              TableCell cellUsersInGroup = item["UsersInGroup"];
              HiddenField hdnGroupId = (HiddenField)cellUsersInGroup.FindControl("hdnGroupId");
              Label lblUsersinGroup = (Label)cellUsersInGroup.FindControl("lblUsersinGroup");
              RadToolTip rtooltipUsersinGroup = (RadToolTip)cellUsersInGroup.FindControl("rtooltipUsersinGroup");
              Guid groupID = new Guid(hdnGroupId.Value);
              string List = "";
              string formattedList = "";
              int count = 0;
              if (groupID != Guid.Empty)
              {
                  List<SQWUser> lstUsers = SQWUserList.GetAllByGroup(groupID);
 
                  foreach (SQWUser ug in lstUsers)
                  {
                      count++;
                      if (List == string.Empty)
                      {
                          List = ug.UserName;
                          formattedList = " " + ug.UserName;
                      }
                      else
                      {
                          if (count <= 10)
                          {
                              List += "," + ug.UserName;
                              formattedList += "<br/> " + ug.UserName;
                          }
                          if (count == 11)
                          {
                              List += "...";
                          }
                          if (count > 10 && count <= 50)
                          {
                              formattedList += "<br/> " + ug.UserName;
                          }
                          if (count > 50)
                          {
                              formattedList += "<br/> ...";
                              break;
                          }
                      }
                  }
              }
              lblUsersinGroup.Text = List;
              rtooltipUsersinGroup.Text = formattedList;
 
              TableCell cellGroupType = item["GroupType"];
              if (cellGroupType.Text.Trim() == "1")
              {
                  cellGroupType.Text = "SQ";
 
              }
              else if (cellGroupType.Text.Trim() == "0")
              {
                  cellGroupType.Text = "AD";
              }
          }
          else if (e.Item is GridCommandItem)
          {
              GridCommandItem item = (GridCommandItem)e.Item;
              RadTextBox rdTextBox = (RadTextBox)item.Controls[0].Controls[1].Controls[5].FindControl("txtsearchusers");
              rdTextBox.Text = lblSearchText.Text;
 
              List<ADProviderKeys> lstADProvider = ADProviderSettings.GetADProviderList();
              RadToolBar rtoolUserList = (RadToolBar)item.FindControl("rtbGroups");
              RadToolBarButton rbtn = (RadToolBarButton)rtoolUserList.FindItemByValue("NewAD");
              
              if (lstADProvider.Count == 0)
              {
                  rbtn.Enabled = false;
                   
              }
              else
              {
                  rbtn.Enabled = true;
                   
              }
          }          
      }
 
      protected void rgGroups_PageIndexChanged(object sender, GridPageChangedEventArgs e)
      {
          rgGroups.CurrentPageIndex = e.NewPageIndex;
          BindGrid();
      }
 
      protected void rgGroups_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
      {
          /* BindGrid() is not called here because Datbind does not work in  NeedDataSource Event*/
          // string sFilter = txtsearchusers.Text.ToString().Trim();
          string sFilter = lblSearchText.Text.ToString().Trim();
 
          if (sFilter != string.Empty)
          {
              rgGroups.DataSource = SQWebNetClasses.SQWUserGroupList.SearchByName(sFilter);
          }
          else
          {
              rgGroups.DataSource = SQWebNetClasses.SQWUserGroupList.GetGroupList();
 
          }
      }
 
      protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
      {
          if (e.Argument == "Rebind")
          {
             // BindGrid();
          }
          else if (e.Argument == "Delete")
          {
              DeleteGroups();
              //BindGrid();
          }
          else if (e.Argument == "Copy")
          {
              CopyGroups();               
          }
         // BindGrid();
          rgGroups.Rebind();
      }
 
      protected override void init_js_culture_label()
      {
          // Fill the array of culture label to cal in javascript by the javascript:getLabel(key)
 
          string[] labels = { "CreateNewGroup", "New", "Edit", "Delete", "Copy", "EditGroup", "DeleteConfirm", "StarQueryWeb", "SaveChanges", "NewAD", "OK", "CancelWindow", "CloseWindow", "Yes","No" };
          aJsPagelabel = labels;
          // Call the base class.
          base.init_js_culture_label();
      }
 
      //protected void btnDeleteUserGroups_Click(object sender, EventArgs e)
      //{
      //    DeleteGroups();
      //    BindGrid();
      //}
 
      protected void CopyGroups()
      {
          SQWUser objUser = SQWUserList.GetByName(Session["UserName"].ToString());
 
          foreach (GridItem grd in rgGroups.SelectedItems)
          {
              SQWUserGroup group = (SQWUserGroup)grd.DataItem;
              HiddenField h = (HiddenField)grd.FindControl("hdnGroupId");
              Guid groupId;
              Guid.TryParse(h.Value, out groupId);
              LinkButton lnkUserName = (LinkButton)grd.FindControl("lnkGroupName");
              string sUserName = lnkUserName.Text;
              if (sUserName.Trim() != string.Empty)
              {
                  group = SQWUserGroupList.GetByName(sUserName);
 
                  string newGroupName = GetCopyGroupName(group.GroupName);
                  SQWUserGroup objGroup = new SQWUserGroup();
                  objGroup.GroupId = Guid.NewGuid();
                  objGroup.GroupName = newGroupName;
                  objGroup.GroupType = (int)SQWebNetClasses.Utility.UserGroupType.StarQuery;//group.GroupType; duplicated group shud be SQ group
                  objGroup.Description = group.Description;
                  objGroup.ADDomain = group.ADDomain;
 
                  SQWUserGroupList.AddGroup(objGroup);
 
                  //List<SQWUserGroup> lstCurrentGroups = SQWUsersGroupsMappings.GetGroupsForUser(group.GroupId);
 
                  List<SQWUser> lstUsers = SQWUserList.GetAllByGroup(groupId);
                  List<SQWReportFile> lstReports = SQWUserGroupReportsMappings.GetAllByGroup(groupId);
                  foreach (SQWUser user in lstUsers)
                  {
                      //SQWUser oUserGroup = SQWUserList.GetByName(user.UserName);
                      SQWUsersGroupsMappings.AddUserGroupMapping(user.UserID, objGroup.GroupId);
 
                      // For User-Group-Reports Mapping //                       
 
                      foreach (SQWReportFile objuserName in lstReports)
                      {
                          SQWUsersReportsMappings.AddUserReportMapping(user.UserID, objuserName.ReportID, true);
                      }
                      // *End* //
 
                  }
                  List<SQWUserGroupMapping> lstUserGroupMappings = SQWUsersGroupsMappings.GetUsersForGroup(groupId);
 
                  foreach (SQWReportFile reports in lstReports)
                  {
                      //SQWReportFile objReportGroup = SQWReportFileList.GetByName(reports.ReportName);
                      SQWUserGroupReportsMappings.AddUserGroupReportMapping(reports.ReportID, objGroup.GroupId);
 
                      //// For User-Group-Reports Mapping //
                      //foreach (SQWUserGroupMapping objSQWUserGroupMapping in lstUserGroupMappings)
                      //{
                      //    SQWUsersReportsMappings.AddUserReportMapping(objSQWUserGroupMapping.UserId, reports.ReportID, true);
                      //}
                      //// *End* //
                  }
              }
          }
          alert(getLocalRessourceObjectForJS("MsgCopyReport").ToString());
          //alert("Group has been copied successfully.");
          //Response.Redirect("UserGroups.aspx");
          
      }
 
      protected string GetCopyGroupName(string oldGroupName)
      {
          List<string> existingNames = new List<string>();
          //existingNames = SQWReportFileList.GetAnalystFileList();
          foreach (SQWUserGroup col in SQWUserGroupList.GetGroupList())
              existingNames.Add(col.GroupName);
          return SQManager.GetNewValidName(oldGroupName, existingNames.ToArray(), '_', false);
      }
 
      protected void DeleteGroups()
      {
          foreach (GridItem grd in rgGroups.SelectedItems)
          {
              HiddenField h = (HiddenField)grd.FindControl("hdnGroupId");
              Guid groupid;
              Guid.TryParse(h.Value, out groupid);
              // Code to delete User from table
              SQWebNetClasses.SQWUserGroupList.DeleteGroup(groupid);
          }
          alert(getLocalRessourceObjectForJS("DeletedMesg").ToString());
          //Response.Redirect("UserGroups.aspx");
      }
 
      protected void alert(string message)
      {
          string title = getLocalRessourceObjectForJS("StarQueryWeb");
          string radalertscript = "<script language='javascript'>function f(){radalert('" + message + "', 330, 100,'" + title + "'); Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
          ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", radalertscript, false);
      }
 
      protected void btnBindUserGroups_Click(object sender, EventArgs e)
      {
          BindGrid();
      }
 
      protected void txtsearchusers_TextChanged(object sender, EventArgs e)
      {
          RadInputControl rdInput = ((Telerik.Web.UI.RadInputControl)(sender));
          lblSearchText.Text = rdInput.Text.Trim();
          BindGrid();
          RadTextBox rdTextbox = (RadTextBox)(rgGroups.MasterTableView.GetItems(GridItemType.CommandItem)[0].Controls[0].Controls[1].Controls[5].FindControl("txtsearchusers"));
          rdTextbox.Text = rdInput.Text.Trim();
      }
 
      protected void rgGroups_SortCommand(object source, Telerik.Web.UI.GridSortCommandEventArgs e)
      {
          //Apply custom sorting
          GridSortExpression sortExpr = new GridSortExpression();
          switch (e.OldSortOrder)
          {
              case GridSortOrder.None:
                  sortExpr.FieldName = e.SortExpression;
                  sortExpr.SortOrder = GridSortOrder.Descending;
 
                  e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                  break;
              case GridSortOrder.Ascending:
                  sortExpr.FieldName = e.SortExpression;
                  sortExpr.SortOrder = rgGroups.MasterTableView.AllowNaturalSort ? GridSortOrder.None : GridSortOrder.Descending;
                  e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                  break;
              case GridSortOrder.Descending:
                  sortExpr.FieldName = e.SortExpression;
                  sortExpr.SortOrder = GridSortOrder.Ascending;
 
                  e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr);
                  break;
          }
          e.Canceled = true;
          rgGroups.Rebind();
      }
 
      protected virtual void UpdatePanel_OnLoad(object sender, EventArgs e)
      {
          if (Page.IsPostBack)
          {
              System.Web.UI.ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AlertBox", "removeClass('ctl00_ContentPlaceHolder1_rgGroups_ctl00_ctl02_ctl00_rtbGroups');", true);
          }
      }
 
      protected void rgGroups_PageSizeChanged(object sender, GridPageSizeChangedEventArgs e)
      {
          string PageLoad = Convert.ToString(ViewState["PageLoad"]);
 
          if (PageLoad != "1")
          {
              SQWPage sqwPage = new SQWPage();
 
              sqwPage.PageName = "UserGroups";
              SQWUser objUser = SQWUserList.GetByName(Session["UserName"].ToString());
              RadComboBox rcb = (RadComboBox)Session["PageSizeComboBox"];
 
              if (rcb != null)
              {
                  if (rcb.Text == getLocalRessourceObjectForJS("All").ToString())
                  {
                      sqwPage.PageSize = "All";
                  }
                  else
                  {
                      sqwPage.PageSize = e.NewPageSize.ToString();
                  }
              }
              else
              {
                  sqwPage.PageSize = e.NewPageSize.ToString();
              }
 
              if (objUser != null)
              {
                  SQWUserList.EditPageSizeSettings(objUser, sqwPage);
              }
 
              objUser = null;
              Session["superadminPageSizeText_UserGroups"] = sqwPage.PageSize;
          }
          Session["superadminPageSizeValue_UserGroups"] = e.NewPageSize; // has put in the session since when new User is added or Edited . it comes back from pop up page and current page gets refreshed so Viewstate is not used.
          SetHeightGrid(e.NewPageSize);
 
      }
 
      private string GetPageSize(SQWUser objUser, string page)
      {
          string oPagesize = "10";
          if (Convert.ToString(Session["LoggedInAs"]) != "superadmin" && objUser != null)
          {
              oPagesize = SQWUserList.GetPageSize(objUser, "UserGroups");
          }
          else
          {
              if (Convert.ToString(Session["superadminPageSizeValue_UserGroups"]) == string.Empty)
              {
                  Session["superadminPageSizeValue_UserGroups"] = oPagesize;
 
              }
              else
              {
                  oPagesize = Convert.ToString(Session["superadminPageSizeValue_UserGroups"]);
                  if (Convert.ToString(Session["superadminPageSizeText_UserGroups"]) == "All")
                  {
                      oPagesize = "All";
                  }
              }
          }
          return oPagesize;
      }
 
      protected string GetTotalRecords()
      {
          string pageSize = "10";
          string sFilter = lblSearchText.Text.Trim();
          if (sFilter != string.Empty)
          {
              pageSize = SQWebNetClasses.SQWUserGroupList.SearchByName(sFilter).Count.ToString();
          }
          else
          {
              pageSize = SQWebNetClasses.SQWUserGroupList.GetGroupList().Count.ToString();
          }
          return pageSize;
      }
 
      protected void rgGroups_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
      {
          if (e.Item is GridPagerItem)
          {
              GridPagerItem pagerItem = (GridPagerItem)e.Item;
              hdngridPaging.Value = "0";
 
              if (pagerItem.Paging.IsFirstPage)
              {
                  if (pagerItem.Paging.PageCount == 1 || pagerItem.Paging.PageCount == 0)
                  {
                      hdngridPaging.Value = "3";
                  }
                  else
                  {
                      hdngridPaging.Value = "1";
                  }
              }
 
              else if (pagerItem.Paging.IsLastPage)
              {
                  hdngridPaging.Value = "2";
              }
 
              SQWUser objUser = SQWUserList.GetByName(Session["UserName"].ToString());
              //string pageSize = SQWUserList.GetPageSize(objUser, "UserGroups");
              string pageSize = GetPageSize(objUser, "UserGroups");
              RadComboBox cb = (e.Item as GridPagerItem).FindControl("PageSizeComboBox") as RadComboBox;
              cb.Items.Clear();
 
              RadComboBoxItem item = new RadComboBoxItem("10", "10");
              item.Attributes.Add("ownerTableViewId", rgGroups.MasterTableView.ClientID);
 
              if (cb.Items.FindItemByValue("10") == null)
                  cb.Items.Add(item);
 
              item = new RadComboBoxItem("20", "20");
              item.Attributes.Add("ownerTableViewId", rgGroups.MasterTableView.ClientID);
 
              if (cb.Items.FindItemByValue("20") == null)
                  cb.Items.Add(item);
 
              item = new RadComboBoxItem("50", "50");
              item.Attributes.Add("ownerTableViewId", rgGroups.MasterTableView.ClientID);
 
              if (cb.Items.FindItemByValue("50") == null)
                  cb.Items.Add(item);
 
              item = new RadComboBoxItem("100", "100");
              item.Attributes.Add("ownerTableViewId", rgGroups.MasterTableView.ClientID);
 
              if (cb.Items.FindItemByValue("100") == null)
                  cb.Items.Add(item);
 
              item = new RadComboBoxItem("200", "200");
              item.Attributes.Add("ownerTableViewId", rgGroups.MasterTableView.ClientID);
 
              if (cb.Items.FindItemByValue("200") == null)
                  cb.Items.Add(item);
 
              TotalItemCount = Convert.ToInt32(GetTotalRecords());
              if (cb.Items.FindItemByValue(TotalItemCount.ToString()) == null)
              {
                  item = new RadComboBoxItem(getLocalRessourceObjectForJS("All").ToString(), TotalItemCount.ToString());
              }
              else
              {
                  int total = TotalItemCount + 1;
                  item = new RadComboBoxItem(getLocalRessourceObjectForJS("All").ToString(), total.ToString());
              }
              item.Attributes.Add("ownerTableViewId", rgGroups.MasterTableView.ClientID);
              cb.Items.Add(item);
 
              cb.Items.Sort(new PagerRadComboBoxItemComparer());
              //cb.FindItemByText(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
              if (cb.Text == getLocalRessourceObjectForJS("All").ToString() || pageSize == "All" || Convert.ToString(Session["superadminPageSizeText_UserGroups"]) == "All")//if (pageSize == "total")
              {
                  cb.FindItemByText(getLocalRessourceObjectForJS("All").ToString()).Selected = true;
              }
              else
              {
                  cb.FindItemByValue(e.Item.OwnerTableView.PageSize.ToString()).Selected = true;
              }
              Session["PageSizeComboBox"] = cb;
 
              objUser = null;
          }        
      }
  }

Iana Tsolova
Telerik team
 answered on 16 Nov 2011
1 answer
79 views
Hello,

Sorry if this has been asked previously, but i have not seen it when searching...

I have a radgrid with 2 nested detail tables. This is using Ajax to populate the expanded tables. On the lowest level table i am associating a label in one of the columns with a RadToolTipManager to open a small summary based on the item clicked on as below:

Ajax Manager:
            <telerik:AjaxSetting AjaxControlID="GridContent">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="GridContent" LoadingPanelID="LoadingPanel" />
                    <telerik:AjaxUpdatedControl ControlID="HistoryToolTipManager" />
                </UpdatedControls>
            </telerik:AjaxSetting>


ItemDataBound grid event:

HistoryToolTipManager.TargetControls.Add(quantityLabel.ClientID, rowIndex.ToString(), true);

I then have an AjaxUpdate method that fires when a click is received on the QuantityLabel control. I can see this firing and can see that the tooltip is being created and populated.

However, the tooltip appears (empty) for about 2 seconds before disappearing again. This seems to be due to the grid also refreshing when the label is clicked on. I can see the content of the tooltip AND the grid being returned in the ajax response and i assume that this grid refresh makes the tooltip disappear again.

Is there any way to disable the grid refresh in this scenario? The ajax grid refreshing for the rest of the grid expansions is a requirement, so disabling all grid ajax is not a possibility.

This is using VS2010 and ASP.Net 4.0 with version 2011.2.712.40 of the Telerik dll.

Many Thanks.

Ben.
Iana Tsolova
Telerik team
 answered on 16 Nov 2011
0 answers
68 views
UPDATE:
My fault. The
MasterTableView.EnableColumnsViewState 
was set to false.

Redards,
Ralf

--------------------

Hi,

I have created a grid with enable grouping an filtering. Each column has a "google like" filter control as the KB article describes. I have added a reset button (ImageButton) to each filter right from the RadComboBox. The grid, the columns and the RadComboBox property EnableViewState is set to false. When I use a column filter all is working fine. The rest button will be displayed. When I reset the filter by clicking on the rest button the filter will be reseted fine and the reset button disapears as expected.
But when I have set a filter and then I have grouped by drag&drop a column into the group box, the text of the RadComboBox and the CurrentFilterValue are empty and the CurrentFilterFunction is NoFilter and the rest button don't will be shown. And the data is still filtered in the grid.
When I filter by one column and then by a second all is working fine. Only when I group the data the problem occur.

The grid will be used in a webpart in a SharePoint solution.


I'm using Telerik version 2011.2.712.35

Do anyone have a tip?

regards,
Ralf
Ralf
Top achievements
Rank 1
 asked on 16 Nov 2011
2 answers
137 views
Hi

I saved the appointment info into database, include start date, end date, recurrence rule and recurrence parent id etc. My question is how can I do overlap checking for the appointment with recurrence rule in database? Because recurentce rule is a long text include all information about date range.

And I also got two minor UI issues in Sharepoint 2010 environment.
1) When I try to add a new appointment, and click save button without any inputs in the popup window, I got error message which said I have to input appointment subject, then I input something into the subject textbox, and click save button again, but nothing happened.
I followed this link http://www.telerik.com/community/forums/aspnet-ajax/scheduler/radschedule-issue-with-updatepanel-in-sharepoint-2010.aspx to solve the js error about popup window, but here is a new one.
2) The radscheduler control obscured the dropdown menu in sharepoint 2010, please check attached screenshot.


Please advice, Thanks
Ivana
Telerik team
 answered on 16 Nov 2011
1 answer
81 views
Hello,
I've seen many complaints here about it, but I think nobody realy solved this issue yet. This issue is most unfortunate as clients complain about not being able to be filtering the grid properly...

The bug is still present even in 2011.3.1025.40 beta.

Here is how to reproduce the error:

1) Radgrid with AutocreateColumns = "true"
2) Advanced databinding
3) Bind it to a datatable, one or more columns should be datetime type
3) Try to perform a filtering using datetime column filter, so that a single row is found (maybe it's the IsEqual condition in filter???)
4) The row is present in datatable, VirtualItemsCount is set to 1, pager says that there is 1 row, but grid displays "no items row"
5) If you try to find the same row using another filter (for example a int-type one) exactly the same row is found, exactly the same row is in datatable and the row is rendered. So probably the erorr dependes of the kind of column you use for filtering?
6) I've tried to completely remove my own modifications to grid, leave it as you provided it (to avoid a bug in my own code), the row is still not being rendered.
7) I've tried to set the RadGrid's DataSource property to null and the again to the DataTable in the NeedDataSource event to "reset it", to set VirtualItemCount propery before and after setting the datasource property, nothing helped. Even if you call the Rebind() method on the grid, it doesn't help.

Radoslav
Telerik team
 answered on 16 Nov 2011
3 answers
157 views
Hi,

I have a large number of RadGrids in my AP.NET AJAX project, and am using the following tag to remove the sort styling applied by the Office2010 skin:

<SortingSettings EnableSkinSortStyles="false" />

Is there a way I can apply this setting to all grids (globally), without having to add the tag to every single RadGrid declaration?

If there's no global setting, what's the best way to manage the application of this type of common attribute across numerous grids?
Mark
Top achievements
Rank 1
 answered on 16 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?