RadGrid not upating columns with virtualization enabled

4 posts, 1 answers
  1. steve
    steve avatar
    14 posts
    Member since:
    Apr 2016

    Posted 12 Jan 2017 Link to this post

    Hi I have a radgrid that I am pumping over 4k rows into. We have enabled virtualization, but we are getting some strange behavior. When the grid is loaded all looks fine, but when the user scrolls down and the virtualization starts to kick in there are columns not updating/refreshing and rows appear to only be going to 500. I have included a video as well to demonstrate. So when a user opens page, the radgrid displays data, but when scrolling down it appears to stop for certain columns. However, when exporting to excel, all rows are correctly displayed and matching among the rows.

     

     

    1) GridTemplateColumn with asp:image tag is only displaying first image when sorting.

    2) It appears that rows are only going to 500 as I believe this is set with ItemsPerView="500"

     

     

    Below is the aspx code:

    <%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/main.Master" CodeBehind="Manager.aspx.vb" Inherits="ContentValidationSystem.Manager" %>
    <%@ Register TagPrefix="UserControl" TagName="ManagerEmail" Src="~/Controls/Manager_Email_Settings.ascx" %>
     
    <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="styles" runat="server">
        <style type="text/css">
            #divFloatingHeader{left:250px; right:0; top:200px; height:80px; overflow:hidden; position:fixed;padding-right:5px;background-color:black;}
     
        .RadGrid_Simple .rgRow > td, .RadGrid_Simple .rgAltRow > td, .RadGrid_Simple .rgEditRow > td, .RadGrid_Simple .rgFooter > td
         {
     
            border-bottom:1px solid lightgrey !important;
        }
     
     
        </style>
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="codeblock" runat="server">
        <telerik:RadCodeBlock runat="server">
            <script type="text/javascript">
                /* this will allow control to be parsed.*/
                function TelerikControls() {
                    this.__defineGetter__("radsearch_UserName", function () {
                        return $find("<%= radsearch_UserName.ClientID%>");
                    });
                    this.__defineGetter__("radgrid_dashboard", function () {
                        return $find("<%= radgrid_Dashboard.ClientID%>")
                    });
                    this.__defineGetter__("radimagebutton_mgr_MultipleProjects", function () {
                        return $find("<%= radimagebutton_mgr_MultipleProjects.ClientID%>")
                    });
                }
     
                var _telerikControls = new TelerikControls();
     
                function rowDblClick(sender, eventArgs) {
                    var objGrid = sender;
                    var objMasterTable = objGrid.get_masterTableView();
                    var row = objMasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
                    //alert(row.getDataKeyValue('CVS_DID'));
                    if (row.getDataKeyValue('DocumentID')) {
                        window.open('../Detail_DID.aspx?did=' + row.getDataKeyValue('DocumentID'), '_self');
                    }
                }
     
                function Resize() {
                    setTimeout(function () {
                        var rdg = $find("<%= radgrid_Dashboard.ClientID%>").GridDataDiv;
                        if (rdg) {
                            var blnStaticHeader = $find("<%= radgrid_Dashboard.ClientID%>").ClientSettings.Scrolling.UseStaticHeaders
                             
                            var parent = $get("divWestSide");
                            //var srchbox = _telerikControls.radsearch_UserName;
                            var headerHeight = 0;
                            var btnHeight = 0;
     
                            if (blnStaticHeader) {
                                var rdgHeader = $find("<%= radgrid_Dashboard.ClientID%>").GridHeaderDiv;
                                headerHeight = rdgHeader.clientHeight;
                            }
                            //var srchbox = _telerikControls.radsearch_UserName;
                            //if (srchbox) { btnHeight = srchbox._element.clientHeight }
     
                            var topdiv = $get("divSearchItems");
                            if (topdiv) {
                                btnHeight = topdiv.clientHeight;
                            }
                             
                            rdg.style.height = ((parent.clientHeight - btnHeight - 30) - headerHeight) + "px";
                        }
     
                    }, 200);
                }
     
                window.onresize = window.onload = Resize;
     
                function HandleScrolling(e) {
                    var grid = $find("<%=radgrid_Dashboard.ClientID%>");
                    var scrollArea = document.getElementById("<%= radgrid_Dashboard.ClientID%>" + "_GridData");
                    if (IsScrolledToBottom(scrollArea)) {
                        var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1);
                        //if the visible items are less than the entire record count      
                        //trigger an ajax request to increase them   
                        if (currentlyDisplayedRecords < 100)
                        { $find("<%= RadAjaxManager_001.ClientID%>").ajaxRequest("LoadMoreRecords"); }
                    }
                }
                //calculate when the scroll bar is at the bottom   
                function IsScrolledToBottom(scrollArea) {
                    var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight;
                    return currentPosition == scrollArea.scrollHeight;
                }
            </script>
        </telerik:RadCodeBlock>
    </asp:Content>
    <asp:Content ID="Content4" ContentPlaceHolderID="radajaxmanagerSection" runat="server">
            <telerik:RadWindowManager   ID="RadWindowManager1" runat="server" EnableShadow="true">
            </telerik:RadWindowManager>
            <script type="text/javascript">
                (function (global, undefined) {
                    var demo = {};
                    function alertCallBackFn(arg) {
                        //radalert("<strong>radalert</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", 350, 250, "Result");
                    }
     
                    function confirmCallBackFn(arg) {
                        //radalert("<strong>radconfirm</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", 350, 250, "Result");
     
                    }
     
                    function promptCallBackFn(arg) {
                        //radalert("After 7.5 million years, <strong>Deep Thought</strong> answers:<h3 style='color: #ff0000;'>" + arg + "</h3>", 350, 250, "Deep Thought");                  
                    }
                    global.alertCallBackFn = alertCallBackFn;
                    global.confirmCallBackFn = confirmCallBackFn;
                    global.promptCallBackFn = promptCallBackFn;
                    global.$dialogsDemo = demo;
     
                })(window);
            </script>
     
        <telerik:RadAjaxManager ID="RadAjaxManager_001" runat="server" OnAjaxRequest="RadAjaxManager_001_AjaxRequest">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="radsearch_UserName">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID ="radgrid_Dashboard" LoadingPanelID="radajaxloadingpanel_GridPanel" />
                        <telerik:AjaxUpdatedControl ControlID="rptStatusInfo" LoadingPanelID="radajaxloadingpanel_GridPanel" />
                        <telerik:AjaxUpdatedControl ControlID="rptUpcomingItems" LoadingPanelID="radajaxloadingpanel_GridPanel" />
                        <telerik:AjaxUpdatedControl ControlID="RadHtmlChart_FrequencyMix" LoadingPanelID="radajaxloadingpanel_GridPanel" />
                        <%--<telerik:AjaxUpdatedControl ControlID="pnlEmailPreferences" LoadingPanelID="radajaxloadingpanel_GridPanel" />--%>
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="radgrid_Dashboard">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="radgrid_Dashboard" LoadingPanelID="radajaxloadingpanel_GridPanel" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
     
        <telerik:RadCodeBlock runat="server">
            <script type="text/javascript">
                $telerik.$(document).ready(function () {
     
                });
     
     
                function GridCreated(sender, args) {
                    sender.get_masterTableView().hideFilterItem();//hide filter menu
                    var scrollArea = sender.GridDataDiv;
                    if (scrollArea) {
                        var blnStaticHeader = sender.ClientSettings.Scrolling.UseStaticHeaders;
                        var parent = $get("divWestSide");
     
                        var headerHeight = 0; var headerWidth = 0;
                        var btnHeight = 0;
     
                        if (blnStaticHeader) {
                            var gridHeader = sender.GridHeaderDiv;
                            headerHeight = gridHeader.clientHeight;
                            headerWidth = gridHeader.clientWidth;
                            //alert(headerWidth);
                        }
                        var topdiv = $get("divSearchItems");
                        if (topdiv) {
                            btnHeight = topdiv.clientHeight;
                        }
                         
                        scrollArea.style.height = ((parent.clientHeight - btnHeight - 30) - headerHeight) + "px";
                        sender.add_rowCreated(RowCreated);
                    }
                }
     
                function RowCreated() {
     
                }
     
                function CheckAll(id) {
                    var masterTable = $find("<%= radgrid_Dashboard.ClientID%>").get_masterTableView();
                    var row = masterTable.get_dataItems();
                    if (id.checked == true) {
                        for (var i = 0; i < row.length; i++) {
                            masterTable.get_dataItems()[i].findElement("cboxSelect").checked = true; // for checking the checkboxes
                            //masterTable.get_dataItems()[i].findElement("chkbx_Select_OnOff").checked = true; // for checking the checkboxes               
                        }
                    }
                    else {
                        for (var i = 0; i < row.length; i++) {
                            masterTable.get_dataItems()[i].findElement("cboxSelect").checked = false; // for unchecking the checkboxes
                            //masterTable.get_dataItems()[i].findElement("chkbx_Select_OnOff").checked = false; // for checking the checkboxes               
                        }
                    }
                }
     
                function unCheckHeader(id) {
     
                    var masterTable = $find("<%= radgrid_Dashboard.ClientID%>").get_masterTableView();
                    var row = masterTable.get_dataItems();
                    if (id.checked == false) {
                        var chkBox = $telerik.$('input[id$=checkAll]');
                        chkBox[0].checked = false;
                    }
     
                }
     
                function OpenRadWindowMultipleDocuments(sender, args) {
     
                    var uiPersonNumber = sender.get_commandArgument();
                    var urlTracker = $get('<%=hdnField_TrackerUrl.ClientID%>').value;
                    var DIDs = ',';
                    //********************************************************************************************
                    var masterTable = $find("<%= radgrid_Dashboard.ClientID%>").get_masterTableView();
                    var rows = masterTable.get_dataItems();
                    for (var i = 0; i < rows.length; i++) {
                        var chkBox = masterTable.get_dataItems()[i].findElement("cboxSelect");
                        var row = rows[i];
                        var tDID = row.get_cell("DocumentID").innerHTML + ',';
                        if (chkBox.checked) { DIDs += tDID }
                    }
                    //********************************************************************************************               
                    var sURLParm = urlTracker + '/new/0/0?cvs=http://' + document.location.host + '/Service/ReportDashboardData.svc/Open_Tracker/' + DIDs + '/' + uiPersonNumber;
                    //var sURLParm = 'http://procmgmt-contentvalidation-dev.bankofamerica.com/Service/ReportDashboardData.svc/Open_Tracker/' + DIDs + '/' + uiPersonNumber;
     
                    window.open(sURLParm, "WindowPopup", "width=800px, height=600px, resizable,scrollbars=1");//test window open;
     
                }
     
     
                function OpenTrackerProject(did, uiPersonNumber) {
                    var urlTracker = $get('<%=hdnField_TrackerUrl.ClientID%>').value;
                    var sURLParm = urlTracker + '/new/0/0?cvs=http://' + document.location.host + '/Service/ReportDashboardData.svc/Open_Tracker/' + did + '/' + uiPersonNumber;
                    //window.status = sURLParm;
                    window.open(sURLParm, "_blank")//"width=800px, height=600px, resizable,scrollbars=1");//test window open;
                    //window.open('http://sharepoint3.bankofamerica.com/sites/ServicingBusinessSupport/PM/pm.html#/home', "WindowPopup", "width=800px, height=600px, resizable");
     
                    <%--var oWnd = $find("<%= radwindow_TrackerInfo.ClientID%>");
                    oWnd.SetUrl(sURLParm);
                    oWnd.setSize(800, 600);
                    oWnd.show();--%>
     
                }
     
                function OpenRadWin(did) {
     
                    var urlTracker = $get('<%=hdnField_TrackerUrl.ClientID%>').value;
                    //var oWnd = $find("<%= radwindow_TrackerInfo.ClientID%>");
                    /*
                    *
                    * This is to stay hard coded until tracker is remediated to TI Production Platform.
                    * use of -dev url is due to Tracker being hosted on Sharepoint Site.
                    *
                    *  when remove the following:
                    *    var sURL = "http://procmgmt-contentvalidation-dev.bankofamerica.com/TrackerInfo.aspx?did=" + did
                    *
                     
                    var sURL = '';
                    sURL = 'http://' + document.location.host + '/TrackerInfo.aspx?did=' + did;
                    */
     
                    //window.status = sURL;
                    //oWnd.SetUrl(sURL);
                    //oWnd.setUrl();
                    //oWnd.setSize(600, 400);
                    //oWnd.show();
                    var sURLParm = urlTracker + '/search?did=' + did + ','
                    window.open(sURLParm, "WindowPopup", "width=800px, height=600px, resizable,scrollbars=1");//test window open;
     
                }
     
     
            </script>
        </telerik:RadCodeBlock>
    </asp:Content>
    <asp:Content ID="Content5" ContentPlaceHolderID="mainContent" runat="server">
     <div style="float:left;"><asp:Label ID="lblMsg" runat="server"></asp:Label></div>
     
    <table>
        <tr>
            <td>
                <div id="divEastSide">
            <table style="width:100%;">
                <tr>
                    <td class="cellInfo">
                        <!-- Status Info -->
                         
                        <asp:Repeater ID="rptStatusInfo" runat="server">
                            <HeaderTemplate>
                                <table class="tblStats">
                                    <tr>
                                        <th colspan="3">
                                            Status
                                        </th>
                                    </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td ><%# ProperCase(DataBinder.Eval(Container.DataItem, "Status").ToString().Trim)%></td>
                                    <td><%# String.Format("{0:G}", DataBinder.Eval(Container.DataItem, "StatusCount"))%></td>
                                    <td><%# String.Format("{0:P0}", DataBinder.Eval(Container.DataItem, "StatusPercentage"))%></td>
                                </tr>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <tr>
                                    <td ><%# ProperCase(DataBinder.Eval(Container.DataItem, "Status").ToString().Trim)%></td>
                                    <td><%# String.Format("{0:G}", DataBinder.Eval(Container.DataItem, "StatusCount"))%></td>
                                    <td><%# String.Format("{0:P0}", DataBinder.Eval(Container.DataItem, "StatusPercentage"))%></td>
                                </tr>
                            </AlternatingItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                         
                    </td>
                </tr>
                <tr>
                    <td>
                        <!-- Upcoming Due Items -->
                        <div style="padding-top:10px;padding-bottom:10px;">
                        <asp:Repeater ID="rptUpcomingItems" runat="server">
                            <HeaderTemplate>
                                <table class="tblStats">
                                    <tr>
                                        <th colspan="2">
                                            Documents Coming Due
                                        </th>
                                    </tr>
                                    <tr>
                                        <td><strong>Review Month</strong></td>
                                        <td><strong>Total</strong></td>
                                    </tr>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <tr>
                                    <td><%#DataBinder.Eval(Container.DataItem, "Review Month")%></td>
                                    <td><%# String.Format("{0:G}", DataBinder.Eval(Container.DataItem, "Total"))%></td>
                                </tr>
                            </ItemTemplate>
                            <AlternatingItemTemplate>
                                <tr>
                                    <td><%#DataBinder.Eval(Container.DataItem, "Review Month")%></td>
                                    <td><%# String.Format("{0:G}", DataBinder.Eval(Container.DataItem, "Total"))%></td>
                                </tr>
                            </AlternatingItemTemplate>
                            <FooterTemplate>
                                </table>
                            </FooterTemplate>
                        </asp:Repeater>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td >
                        <!-- Frequency PieChart -->
                        <table class="tblStats" >
                            <tr>
                                <th colspan="2">
                                    Frequency Mix
                                </th>
                            </tr>
                            <tr>
                                <td colspan="2">
                                <telerik:RadHtmlChart id="RadHtmlChart_FrequencyMix" Transitions="true" runat="server" Width="195px" Height="200px">
                                    <ChartTitle Text="Frequency Mix">
                                        <Appearance Visible="false"></Appearance>
                                    </ChartTitle>
                                    <Legend>
                                        <Appearance Visible="false"></Appearance>
                                    </Legend>
                                    <Appearance>
                                        <FillStyle BackgroundColor="White" />
                                    </Appearance>
                                    <PlotArea>
                                        <Series>
                                            <telerik:PieSeries StartAngle="90" DataFieldY="FreqPercentage" NameField="Frequency" ExplodeField="Exploded" ColorField="SeriesColor">
                                                <LabelsAppearance DataField="Frequency" Position="InsideEnd" DataFormatString="{0}">
                                                    <TextStyle FontFamily="Connections" FontSize="7pt" Color="Black" Padding="2px" />
                                                </LabelsAppearance>
                                                <TooltipsAppearance Color="White" DataFormatString="{0:p2}"></TooltipsAppearance>
                                                <Appearance Overlay-Gradient="RoundedBevel"></Appearance>
                                            </telerik:PieSeries>
                                        </Series>
                                    </PlotArea>
                                </telerik:RadHtmlChart>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <%--Email Preferences Here--%>                   
                        <UserControl:ManagerEmail ID="manageremail_MgrEmailPreferences" runat="server" EnableViewState="true" />
                         
                    </td>
                </tr>
            </table>
                </div>
            </td>
            <td>
     
                <div id="divWestSide">
                    <div class="floatleftdiv">
                        <telerik:RadImageButton ID="radimagebutton_mgr_MultipleProjects" Text="Open Project(s)" CssClass="radgrid_lightblue_gradient display_inline_block" runat="server"
                            Width="125px" Height="50px" Font-Size="X-Small" ForeColor="White" OnClientClicked="OpenRadWindowMultipleDocuments" AutoPostBack="false" >
                        </telerik:RadImageButton><asp:HiddenField ID="hdnField_TrackerUrl" runat="server" />
                    </div>
                    <div id="divSearchItems" class="floatrightdiv">
                        <table>
                             <tr>
                                <td >
                                <div class="floatleftdiv"><span>Dashboard</span>
                                    </div>
                                <div class="floatrightdiv">
                                   <asp:Button ID="btnPopulate_radsearch_Dashboard" runat="server" text="Me" CssClass="AspButtonAsHyperLink" OnClick="hyperButton_Click" CommandArgument="radsearch_UserName" CommandName="updateSearchBox_andPopulate" />
                                </div>
                                </td>
                                 <td />
                            </tr>
                           <tr>
                                <td>
                        <telerik:RadSearchBox ID="radsearch_UserName" runat="server" 
                            width="460px"
                            DataSourceID="SqlDataSource1"
                            DropDownSettings-Height="300"
                            DataTextField ="FullName"
                            DataValueField="userid"
                            DataKeyNames="userid"
                            EmptyMessage="Lastname, Firstname"
                            Filter="Contains"
                            MaxResultCount="20"
                            OnDataSourceSelect="radsearch_UserName_DataSourceSelect"
                            OnSearch="radsearch_UserName_Search"
                            DropDownSettings-CssClass="cellInfo"
                            >
                        </telerik:RadSearchBox>
                        </td><td>
                        <asp:ImageButton ID="imgbtn_ExcelExport" runat="server" ImageUrl="~/Includes/images/Excel_XLSX.png" OnClick="ImageButton_Click" AlternateText="ExcelML" Height="25px" />               
     
                                </td>
                            </tr>
                        </table>
                    </div
                    <telerik:RadAjaxLoadingPanel ID="radajaxloadingpanel_GridPanel" runat="server"></telerik:RadAjaxLoadingPanel>
                    <telerik:RadGrid
                        RenderMode="Classic"
                        CssClass="leftbound"
                        ID="radgrid_Dashboard"
                        AllowFilteringByColumn="true"
                        runat="server"
                        
                        AllowPaging="false"
                         
                        AllowSorting="true"
                        GroupingEnabled="False"
                        width="100%"
                        AutoGenerateColumns="false"
                        OnItemCreated="radgrid_Dashboard_ItemCreated"
                        OnItemDataBound="radgrid_Dashboard_ItemDataBound"
                        ClientSettings-Resizing-AllowResizeToFit="true"
                        OnSortCommand="radgrid_Dashboard_SortCommand"
                        OnExcelMLWorkBookCreated="radgrid_Dashboard_ExcelMLWorkBookCreated"   
                        OnExcelMLExportRowCreated="radgrid_Dashboard_ExcelMLExportRowCreated"
                        OnInfrastructureExporting="radgrid_Dashboard_InfrastructureExporting"  
                        Skin="Simple"
                        >
                        <ExportSettings>
                            <Excel Format="BIFF" AutoFitImages="true" DefaultCellAlignment="Left" />
                        </ExportSettings>
                         
                        <MasterTableView
                            DataKeyNames="ID,DocumentId"
                            CommandItemDisplay="None"
                            HorizontalAlign="NotSet"
                            AutoGenerateColumns="false"
                            ClientDataKeyNames="DocumentID,Title"
                            TableLayout="Fixed"
                            Width="100%"
                        EnableHeaderContextMenu="true"
                        EnableHeaderContextFilterMenu="true"
                            >
                            <NoRecordsTemplate>
                                <span class="NoRecords">
                                    User is not a Primary Manager, Delegate, or Majority Owner for any documents.
                                </span>
                            </NoRecordsTemplate>
                        <Columns>
                                <%-- id column not visible --%>
                                <telerik:GridBoundColumn HeaderText="ID" DataField="ID" UniqueName="ID" Visible="false" ReadOnly="true">
                                    <HeaderStyle Width="50px" />
                                </telerik:GridBoundColumn>                                     
                            <%--checkbox column--%>
                            <telerik:GridTemplateColumn UniqueName="SelectItem" EnableHeaderContextMenu="false">
                                <HeaderStyle Width="50px"/>
                                <ItemStyle HorizontalAlign="Center" />
                                <HeaderTemplate>
                                    <asp:CheckBox ID="checkAll" runat="server" onclick="CheckAll(this)" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cboxSelect" runat="server" onclick="unCheckHeader(this)" />
    <%--                                            <div class="onoffswitch" style="float:left;">
                                        <asp:CheckBox ID="chkbx_Select_OnOff" runat="server" onclick="unCheckHeader(this)" />
                                        <label id="lbl_Select_OnOff" runat="server">
                                            <span class="onoffswitch-inner"></span>
                                            <span class="onoffswitch-switch"></span>
                                        </label>
                                    </div>--%>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <%-- 2nd Flag Column --%>
                                <telerik:GridTemplateColumn UniqueName="GapFlag2" DataField ="GapFlag" AllowFiltering="true" SortExpression="Gap" >
                                    <HeaderStyle Width="50px" />
                                    <HeaderTemplate>
                                        <asp:Label ID="lbl_dummyGap" CssClass="gridHeaderItem" runat="server" Text="Gap"></asp:Label>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <asp:Image ID="img_GapFlag" runat="server"  Width="15px" Height="15px" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
    <%--                            <telerik:GridBoundColumn HeaderText="Gap" DataField="Gap" UniqueName="Gap">
                                    <HeaderStyle Width="50px" />
                                    <ItemStyle HorizontalAlign="left" Wrap="true" />
                                </telerik:GridBoundColumn>--%>
                                <%-- flag column --%>
    <%--                            <telerik:GridImageColumn
                                    DataType="System.String"
                                    DataImageUrlFields="GapFlag"
                                    DataImageUrlFormatString="{0}"
                                    ImageAlign="AbsMiddle"
                                    ImageHeight="15px"
                                    ImageWidth="15px"
                                    HeaderText="Gap"
                                    UniqueName="GapFlag"
                                    EnableHeaderContextMenu="false"
                                    >
                            <HeaderStyle Width="50px" />
                                </telerik:GridImageColumn>--%>
                            <%--System of Record Column--%>
                                <telerik:GridBoundColumn HeaderText="Sys_Of_Record" DataField="Sys_Of_Record" UniqueName="Sys_Of_Record"
                                    AllowFiltering="true" Visible="false">
                                    <HeaderStyle Width="150px" />
                                    <ItemStyle HorizontalAlign="left" Wrap="true" />
                                </telerik:GridBoundColumn>
                            <%--DocumentID Column--%>
                                <telerik:GridBoundColumn HeaderText="DocumentID" DataField="DocumentID" UniqueName="DocumentID"
                                    AllowFiltering="true"  CurrentFilterFunction="StartsWith">
                                    <HeaderStyle Width="250px" />
                                    <ItemStyle HorizontalAlign="left" Wrap="true" />
                                </telerik:GridBoundColumn>
                            <%--Hyperlink Column for Title--%>
                                <telerik:GridTemplateColumn UniqueName="TitleLink" AllowSorting="true" DataField="Title"
                                    AllowFiltering="true" CurrentFilterFunction="StartsWith">
                                <HeaderStyle Width="350px" />
                                <ItemStyle HorizontalAlign="left" Width="100%" />
                                <HeaderTemplate>
                                    <asp:Label ID="lbl_dummytitle" CssClass="gridHeaderItem" runat="server" Text="Title"></asp:Label>
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <a href="<%# DataBinder.Eval(Container.DataItem, "Link")%>" target="•_blank" ><%# DataBinder.Eval(Container.DataItem, "Title")%></a>
                                </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            <%--Title Column - used in exports--%>
                                <telerik:GridBoundColumn HeaderText="Title" DataField="Title" UniqueName="TitleExport" Visible="true" Display="false">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>
                                <%--Chapter Column--%>
                                <telerik:GridBoundColumn HeaderText ="Chapter" DataField="Chapter" UniqueName="Chapter"
                                    AllowFiltering="true" CurrentFilterFunction="StartsWith">
                                    <HeaderStyle Width="350px" />
                                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                                </telerik:GridBoundColumn>
                            <%--Category Column--%>
                                <telerik:GridBoundColumn HeaderText="Category" DataField="Category" UniqueName="Category">
                                    <HeaderStyle Width="200px" />
                                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                                </telerik:GridBoundColumn>
                            <%-- Topic/Grouping Column --%>
                                <telerik:GridBoundColumn HeaderText="Topic/Group" DataField="Topic_Grouping" UniqueName="Topic_Grouping">
                                    <HeaderStyle Width="300px" />
                                    <ItemStyle HorizontalAlign="left" Wrap="false" />
                                </telerik:GridBoundColumn>
                            <%--Frequency Column--%>
                                <telerik:GridBoundColumn HeaderText="Frequency" DataField="Frequency" UniqueName="Frequency">
                                    <HeaderStyle Width="100px" />
                                    <ItemStyle HorizontalAlign="Center" Wrap="false" />
                                </telerik:GridBoundColumn>
                            <%--Document Status Color Not visible--%>
                                <telerik:GridBoundColumn HeaderText="Document_Status_Color" DataField="Document_Status_Color" UniqueName="Document_Status_Color" Visible="true" Display="false">
                                    <HeaderStyle Width="50px" />
                                </telerik:GridBoundColumn>
                            <%--Next Review Date Column--%>
                                <telerik:GridDateTimeColumn HeaderText="Next<br/>Review" DataField="Next_Review_DtTM" UniqueName="Next_Review_DtTM" DataFormatString="{0:M/d/yyyy}"
                                    AllowFiltering="true" CurrentFilterFunction="StartsWith">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridDateTimeColumn>
                                <telerik:GridDateTimeColumn HeaderText="Next<br/>Review<br/>NoColor" DataField="Next_Review_DtTM" UniqueName="Next_Review_DtTM_NoColor" DataFormatString="{0:M/d/yyyy}"
                                    AllowFiltering="true" CurrentFilterFunction="StartsWith">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridDateTimeColumn>
                            <%-- Area --%>
                            <telerik:GridBoundColumn HeaderText="Area" DataField="Area" UniqueName="Area" Visible="true" Display="false">
                                <HeaderStyle Width="50px" />
                                <ItemStyle Wrap="false"  />
                                </telerik:GridBoundColumn>
                            <%--Status column--%>
                            <telerik:GridBoundColumn HeaderText="Status" DataField="Status" UniqueName="Status">
                                <HeaderStyle Width="125px" />
                                <ItemStyle Wrap="false"  />
                                </telerik:GridBoundColumn>
                            <%--Primary Manager Column--%>
                            <telerik:GridBoundColumn HeaderText="Primary Manager" DataField="Primary_Manager" UniqueName="Primary_Manager">
                                <HeaderStyle Width="350px" />
                                </telerik:GridBoundColumn>
                            <%--Majority Owner / Manager Column--%>
                            <telerik:GridBoundColumn HeaderText="Manager" DataField="Manager" UniqueName="Manager">
                                <HeaderStyle Width="350px" />
                                </telerik:GridBoundColumn>
                            <%--Team Name Column--%>
                            <telerik:GridBoundColumn HeaderText="Team Name" DataField="Team" UniqueName="Team_Name">
                                <HeaderStyle Width="350px" />
                                </telerik:GridBoundColumn>
                            <%--Content Owner Column--%>
                            <telerik:GridBoundColumn HeaderText="Content Owners" DataField="ContentOwners" UniqueName="ContentOwners">
                                <HeaderStyle Width="350px" />
                                </telerik:GridBoundColumn>
                            <%-- StakeHolder Column --%>
                            <telerik:GridBoundColumn HeaderText="Stakeholders" DataField="Stakeholders" UniqueName="Stakeholders"  >
                                <HeaderStyle Width="350px" />
                                </telerik:GridBoundColumn>
                            <%-- Number Of Hits Column --%>
                            <telerik:GridBoundColumn HeaderText="Hits" DataField="Last_Months_Hits" UniqueName="Last_Months_Hits">
                                <HeaderStyle Width="350px" />
                                </telerik:GridBoundColumn>
                            <%-- Comments Column --%>
                            <telerik:GridBoundColumn HeaderText="Comments" DataField="Comments" UniqueName="Comments" >
                                <HeaderStyle Width="400px" />
                                </telerik:GridBoundColumn>
                            <%-- Open Tracker project --%>
                            <telerik:GridButtonColumn HeaderText="Actions" UniqueName="TrackerSingleProject" Text="Open Project" ButtonType="ImageButton" CommandName="OpenSingleTrackerProjectWindow" EnableHeaderContextMenu="false">
                                <HeaderStyle Width="200px" />
                                <ItemStyle CssClass="radgrid_lightblue_gradient" VerticalAlign="Middle" HorizontalAlign="Center" />
                            </telerik:GridButtonColumn>
                            <%-- Search Tracker for DID --%>
                            <telerik:GridButtonColumn HeaderText="Tracker" UniqueName="ViewTrackerInfo" Text="DID Search" ButtonType="ImageButton" CommandName="OpenFromCodeBehind" EnableHeaderContextMenu="false">
                                <HeaderStyle Width="200px" />
                                <ItemStyle CssClass="radgrid_lightblue_gradient" VerticalAlign="Middle" HorizontalAlign="Center" />
                            </telerik:GridButtonColumn>
                            </Columns>
                             
                        <HeaderStyle VerticalAlign="Bottom" HorizontalAlign="Center" Wrap="false"  Font-Bold="true" Font-Size="12pt" Font-Names="Connections" />
                        <ItemStyle Font-Size="10pt" Font-Names="Connections" />
                        <AlternatingItemStyle Font-Size="10pt" Font-Names="Connections" BackColor="WhiteSmoke" />
                        </MasterTableView>
                     
                    <ClientSettings>
                        <Resizing
                            AllowColumnResize="True" AllowRowResize="false" ResizeGridOnColumnResize="false"
                            ClipCellContentOnResize="true" EnableRealTimeResize="false" AllowResizeToFit="true" />
                        <ClientEvents OnRowDblClick="rowDblClick" OnGridCreated="GridCreated" OnScroll="HandleScrolling" />
                        <%--<Scrolling AllowScroll="true" ScrollHeight="300px" UseStaticHeaders="true" SaveScrollPosition="true" FrozenColumnsCount="3" />--%>
                        <Scrolling AllowScroll="true"
                            ScrollHeight="300px"
                            UseStaticHeaders="true"
                            FrozenColumnsCount="3"
                            />
                        <Virtualization EnableVirtualization="true" LoadingPanelID="radajaxloadingpanel_GridPanel"
                            InitiallyCachedItemsCount="500"
                            ItemsPerView="500"
                            MaxCacheSize="2000"
                            RetrievedItemsPerRequest="500"  
                            />
                    </ClientSettings>
                    </telerik:RadGrid>
                </div>
            </td>
        </tr>
    </table>
     
    <telerik:RadWindow runat="server" ID="radwindow_TrackerInfo" Width="650px" Height="400px"
        ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true">
    </telerik:RadWindow>
     
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:COOD %>"
            SelectCommand="CVS.Get_ManagerList"
            SelectCommandType ="StoredProcedure"
            >
        </asp:SqlDataSource>
    </asp:Content>

     

    Below is vb code

    Imports Telerik.Web.UI
    Imports System.Linq
    Imports System.Data
    Imports System.Collections.Generic
    Imports xi = Telerik.Web.UI.ExportInfrastructure
    Imports System.IO
    Imports Telerik.Web.UI.GridExcelBuilder
    Imports System.Drawing
     
    Public Class Manager : Inherits clsWebForm
        Dim ui As New clsUser
        Dim isExport As Boolean = False
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            ui = CType(Session("User_Info_Map"), clsUser)
            Dim lblTitle As Label = TryCast(Master.FindControl("lblApplicationName"), Label)
            lblTitle.Text = String.Format("{0} - {1} Dashboard", Application("Title").ToString(), Path.GetFileNameWithoutExtension(Page.AppRelativeVirtualPath))
            radimagebutton_mgr_MultipleProjects.CommandArgument = ui.PersonNumber.ToString
            hdnField_TrackerUrl.value = ConfigurationManager.AppSettings("TrackerAddress").ToString()
            radgrid_Dashboard.SortingSettings.SortToolTip = "Right Click Menu for options"
     
            'load most current email settings.
            Try
                Dim dsManagerEmailSettings As DataSet = New DataSet
                Dim mgrEmailEnabled As Boolean = False
                Dim mgrEmailFreq As String = "Daily"
                Dim mgrDesktopSLA As Integer = 4
                Dim mgrStandardSLA As Integer = 4
                dsManagerEmailSettings = GetDataSet(String.Format("exec CVS.get_User_email_preferences {0}", ui.PersonNumber), False)
                If Not IsNothing(dsManagerEmailSettings) Then
     
                    If Not IsDBNull(dsManagerEmailSettings.Tables(0).Rows(0)("Email_Enabled")) Then
                        mgrEmailEnabled = dsManagerEmailSettings.Tables(0).Rows(0)("Email_Enabled")
                    End If
                    If Not IsDBNull(dsManagerEmailSettings.Tables(0).Rows(0)("Email_Descr")) Then
                        mgrEmailFreq = dsManagerEmailSettings.Tables(0).Rows(0)("Email_Descr")
                    End If
     
                    If Not IsDBNull(dsManagerEmailSettings.Tables(0).Rows(0)("DesktopSLA")) Then
                        mgrDesktopSLA = dsManagerEmailSettings.Tables(0).Rows(0)("DesktopSLA")
                    End If
     
                    If Not IsDBNull(dsManagerEmailSettings.Tables(0).Rows(0)("StandardsSLA")) Then
                        mgrStandardSLA = dsManagerEmailSettings.Tables(0).Rows(0)("StandardsSLA")
                    End If
     
                    manageremail_MgrEmailPreferences.Manager_PersonNumber = ui.PersonNumber 'dsManagerEmailSettings.Tables(0).Rows(0)("Person_Num")
                    manageremail_MgrEmailPreferences.Manager_EmailEnabled = mgrEmailEnabled
                    manageremail_MgrEmailPreferences.Manager_EmailFrequency = mgrEmailFreq
                    manageremail_MgrEmailPreferences.Manager_DesktopSLA = mgrDesktopSLA
                    manageremail_MgrEmailPreferences.Manager_StandardsSLA = mgrStandardSLA
                    'manageremail_MgrEmailPreferences.Visible = True
                    If Not IsDBNull(dsManagerEmailSettings.Tables(0).Rows(0)("Visible")) Then
                        manageremail_MgrEmailPreferences.Manager_SLAVisible = dsManagerEmailSettings.Tables(0).Rows(0)("Visible")
                    End If
                End If
     
     
            Catch ex As Exception
                lblMsg.Text = ex.Message
            End Try
     
            If Not Page.IsPostBack Then
                ui.UrlViews.Add(Request.RawUrl)
                load_sidemenu_and_radgrid(ui.PersonNumber)
                'manageremail_MgrEmailPreferences.ChangeCheckBoxValue(False)
            End If
     
        End Sub
     
     
        Protected Sub load_sidemenu_and_radgrid(ByVal iPersonNumber As Integer)
            Try
     
                'load all to one dataset (mulitple tables inside)
                '1-griddata
                '2-Summary data
                '3-Chart data
                'pnlEmailPreferences.Visible = False
                'pnlEmailPreferences.Enabled = False
                Dim qryCmd As String = String.Format("exec CVS.Get_Dashboard_Manager '{0}'", iPersonNumber)
     
                Dim dsMain As DataSet = GetDataSet(qryCmd, False)
     
     
     
                If Not IsNothing(dsMain) Then
     
                    'radgrid_Dashboard.DataSource = GetDataSet(qryCmd, False)
                    rptStatusInfo.DataSource = dsMain.Tables(1)
                    rptStatusInfo.DataBind()
                    '
                    rptUpcomingItems.DataSource = dsMain.Tables(2)
                    rptUpcomingItems.DataBind()
     
                    RadHtmlChart_FrequencyMix.DataSource = dsMain.Tables(3)
                    RadHtmlChart_FrequencyMix.DataBind()
     
                    If (Not Session("GridDT") Is Nothing) Then
                        Session.Remove("GridDT")
                    End If
                    Session("GridDT") = dsMain.Tables(0)
     
                    'radgrid_Dashboard.DataSource = dsMain.Tables(0)
                    radgrid_Dashboard.DataSource = Session("GridDT")
                    'radgrid_Dashboard.DataSource = TryCast(Session("GridDT"), DataTable).AsEnumerable().Where(Function(row, index) index > 0 AndAlso index < 200).CopyToDataTable()
                    radgrid_Dashboard.DataBind()
                    'radgrid_Dashboard.VirtualItemCount = TryCast(Session("GridDT"), DataTable).Rows.Count()
     
     
                End If
     
            Catch ex As Exception
                Response.Write(String.Format("Error in {0}<br/>Error Message:{1}", System.Reflection.MethodBase.GetCurrentMethod().Name, ex.Message))
            End Try
     
        End Sub
     
     
     
        Protected Sub hyperButton_Click(sender As Object, e As EventArgs)
            'RadWindowManager1.RadAlert("text", 350, 230, "title", "alertCallBackFn")
            Dim ui As clsUser = CType(Session("User_Info_Map"), clsUser)
            Dim ds As DataSet = GetDataSet(String.Format("select top 1 FullName,Person_Num, Manager_Person_Num ,GroupLeader_Person_Num from CVS.tbl_User_Detail where Standard_Id = '{0}' ", ui.UserId))
            Dim sUserFullName As String = ds.Tables(0).Rows(0)("FullName").ToString() '= ExecuteSqlCmdScalar(String.Format("select FullName from CVS.tbl_User_Detail where Standard_Id = '{0}' ", ui.UserId))
     
            Dim btn As Button = DirectCast(sender, Button)
     
     
            Select Case btn.CommandName
                Case "updateSearchBox_andPopulate"
                    Dim radSrchBox As RadSearchBox = DirectCast(btn.Parent.FindControl(btn.CommandArgument), RadSearchBox)
                    'radsearch_UserName.Text = sUserFullName
                    radSrchBox.Text = sUserFullName
                    load_sidemenu_and_radgrid(ui.PersonNumber)
            End Select
     
        End Sub
     
    #Region "RadGrid"
     
        Protected Sub radgrid_Dashboard_NeedDataSource(sender As Object, e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles radgrid_Dashboard.NeedDataSource
            'Dim iRadSearchBoxUserId As Integer = ExecuteSqlCmdScalar(String.Format("exec CVS.Get_SpecificUserDetail 'FullName', '{0}','Person_Num','int'", radsearch_UserName.Text))
            'Dim queryCmd As String = String.Format("exec CVS.Get_Dashboard_Manager '{0}'", IIf(iRadSearchBoxUserId = 0, ui.PersonNumber, iRadSearchBoxUserId))
            'TryCast(sender, RadGrid).DataSource = GetDataSet(queryCmd, False)
            Dim objGrid As RadGrid = TryCast(sender, RadGrid)
            objGrid.DataSource = Session("GridDT")
     
     
            'Dim objGrid As RadGrid = TryCast(sender, RadGrid)
            'objGrid.DataSource = TryCast(Session("GridDT"), DataTable).Select(String.Format("ID >={1} and ID<={0} ", objGrid.CurrentPageIndex * objGrid.PageSize, objGrid.CurrentPageIndex + 1), "ID")
     
            'Dim firstRowId As Integer = objGrid.CurrentPageIndex * objGrid.PageSize
            'Dim secondRowId As Integer = (objGrid.CurrentPageIndex + 1) * objGrid.PageSize
            'If isExport Then
            '    firstRowId = 0
            '    secondRowId = TryCast(Session("GridDT"), DataTable).Rows.Count()
            'End If
            'objGrid.DataSource = TryCast(Session("GridDT"), DataTable).Select(String.Format("ID >={0} and ID<={1} ", firstRowId, secondRowId), "ID")
     
     
        End Sub
     
        Protected Sub radgrid_Dashboard_ItemCreated(sender As Object, e As GridItemEventArgs)
            If ((e.Item.ItemType = GridItemType.FilteringItem) And (isExport)) Then
                e.Item.Visible = False
            End If
     
            If (e.Item.ItemType = GridItemType.Header) Then
                Dim hItem As GridHeaderItem = DirectCast(e.Item, GridHeaderItem)
                Dim chk1 As CheckBox = DirectCast(hItem.FindControl("checkAll"), CheckBox)
            End If
        End Sub
     
        Protected Sub radgrid_Dashboard_ItemDataBound(sender As Object, e As GridItemEventArgs)
            If (TypeOf (e.Item) Is GridDataItem) Then
     
                Dim objDataBoundItem As GridDataItem = DirectCast(e.Item, GridDataItem)
                Dim DBCELLCOLORNAME As String = IIf(IsDBNull(objDataBoundItem("Document_Status_Color").Text), "WHITE", objDataBoundItem("Document_Status_Color").Text)
     
                objDataBoundItem("Next_Review_DtTM").BackColor = Drawing.Color.FromName(DBCELLCOLORNAME)
                objDataBoundItem("Chapter").Text = objDataBoundItem("Chapter").Text.Replace("|", "<br/>")
                objDataBoundItem("Chapter").Text = objDataBoundItem("Chapter").Text.Replace("&", "&")
                objDataBoundItem("Topic_Grouping").Text = objDataBoundItem("Topic_Grouping").Text.Replace("|", "<br/>")
                objDataBoundItem("Primary_Manager").Text = objDataBoundItem("Primary_Manager").Text.Replace("|", "<br/>")
                objDataBoundItem("Manager").Text = objDataBoundItem("Manager").Text.Replace("|", "<br/>")
                objDataBoundItem("ContentOwners").Text = objDataBoundItem("ContentOwners").Text.Replace("|", "<br/>")
                objDataBoundItem("Team_Name").Text = objDataBoundItem("Team_Name").Text.Replace("|", "<br/>")
                objDataBoundItem("Stakeholders").Text = objDataBoundItem("Stakeholders").Text.Replace("|", "<br/>")
     
                Dim DID As String = objDataBoundItem.DataItem("DocumentId")
                Dim Title As String = objDataBoundItem.DataItem("Title")
                Dim Chapter As String = objDataBoundItem.DataItem("Chapter")
     
                'Dim lblTitle As Label = TryCast(Master.FindControl("lblApplicationName"), Label)
                Dim objCtrlImage As System.Web.UI.WebControls.Image = TryCast(objDataBoundItem.FindControl("img_GapFlag"), System.Web.UI.WebControls.Image)
                objCtrlImage.ImageUrl = IIf(IsDBNull(objDataBoundItem.DataItem("GapFlag")), "", objDataBoundItem.DataItem("GapFlag"))
                'objCtrlImage.ImageUrl = TryCast(objDataBoundItem("GapFlag").Controls(0), System.Web.UI.WebControls.Image).ImageUrl
     
     
            End If
        End Sub
     
     
        Protected Sub radgrid_Dashboard_SortCommand(sender As Object, e As GridSortCommandEventArgs)
            'To allow only sorting by Ascending
            'If Not e.Item.OwnerTableView.SortExpressions.ContainsExpression(e.SortExpression) Then
            '    Dim sortExpr As New GridSortExpression()
            '    sortExpr.FieldName = e.SortExpression
            '    sortExpr.SortOrder = GridSortOrder.Ascending
            '    e.Item.OwnerTableView.SortExpressions.AddSortExpression(sortExpr)
            'End If
     
        End Sub
     
        Protected Sub radgrid_Dashboard_ExcelMLWorkBookCreated(sender As Object, e As GridExcelBuilder.GridExcelMLWorkBookCreatedEventArgs)
            Dim objTable As TableElement = e.WorkBook.Worksheets(0).Table
            For Each objRow As RowElement In objTable.Rows
                'ApplyRowStyle(objRow, "CommonRow")
            Next
        End Sub
     
     
        Protected Sub radgrid_Dashboard_ExcelMLExportRowCreated(sender As Object, e As GridExportExcelMLRowCreatedArgs)
            Dim strTmp As String
            strtmp = ""
     
        End Sub
     
        Protected Sub radgrid_Dashboard_InfrastructureExporting(sender As Object, e As GridInfrastructureExportingEventArgs)
            Dim CharacterPixelLength As Double = 7.25
            e.ExportStructure.Tables(0).Rows(1).Style.BackColor = Color.Black
            e.ExportStructure.Tables(0).Rows(1).Style.ForeColor = Color.White
            e.ExportStructure.Tables(0).Rows(2).Height = 0.0 'hide filter row
            e.ExportStructure.ColumnWidthUnit = ExportInfrastructure.ExportUnitType.Pixel
     
            Dim lstOfColumnWidths As New List(Of Integer)
            For Each objcell As ExportInfrastructure.Cell In e.ExportStructure.Tables(0).Rows(1).Cells
                lstOfColumnWidths.Add(e.ExportStructure.Tables(0).Columns(objcell.ColIndex).Width)
            Next
     
            'data rows
            For i As Integer = 2 To e.ExportStructure.Tables(0).Rows.Count
                'e.ExportStructure.Tables(0).Rows(i).Style.BackColor = IIf(i Mod 2 = 0, Color.White, Color.LightGray)
                For Each objCell As ExportInfrastructure.Cell In e.ExportStructure.Tables(0).Rows(i).Cells
                    objCell.Value = objCell.Text.Replace(Chr(10), ";")
                    objCell.Value = objCell.Text.Replace("&", "&").Replace(""", """").Replace("<", "<").Replace(">", ">")
                    If lstOfColumnWidths(objCell.ColIndex - 1) < (CharacterPixelLength * objCell.Text.Length) Then
                        lstOfColumnWidths(objCell.ColIndex - 1) = (CharacterPixelLength * objCell.Text.Length)
                    End If
                    objCell.Style.BackColor = IIf(objCell.Style.BackColor.Name = "", Color.White, objCell.Style.BackColor)
                    objCell.Style.HorizontalAlign = HorizontalAlign.Left
                    objCell.Style.BorderTopStyle = BorderStyle.Solid
                    objCell.Style.BorderBottomStyle = BorderStyle.Solid
                    objCell.Style.BorderLeftStyle = BorderStyle.Solid
                    objCell.Style.BorderRightStyle = BorderStyle.Solid
     
                    objCell.Style.BorderBottomColor = Color.Black
                    objCell.Style.BorderTopColor = Color.Black
                    objCell.Style.BorderLeftColor = Color.Black
                    objCell.Style.BorderRightColor = Color.Black
                Next
            Next
     
            For Each objcell As ExportInfrastructure.Cell In e.ExportStructure.Tables(0).Rows(1).Cells
                e.ExportStructure.Tables(0).Columns(objcell.ColIndex).Width = lstOfColumnWidths(objcell.ColIndex - 1)
                'e.ExportStructure.Tables(0).Columns(objcell.ColIndex).Width = 360
            Next
     
            radgrid_Dashboard.ClientSettings.Virtualization.ItemsPerView = 500
     
            isExport = False
        End Sub
     
     
        Protected Sub radgrid_Dashboard_FilterCheckListItemsRequested(sender As Object, e As GridFilterCheckListItemsRequestedEventArgs)
            Dim objDataField As String = String.Empty
            Dim objRadGrid As RadGrid = TryCast(sender, RadGrid)
     
            If (TypeOf e.Column Is GridBoundColumn) Then
                objDataField = TryCast(e.Column, IGridDataColumn).GetActiveDataField()
            Else
                objDataField = TryCast(e.Column, GridTemplateColumn).HeaderText
     
                'Dim msgtxt As String = e.Column.ColumnType.ToString()
            End If
            e.ListBox.DataSource = GetFilterListDataSetByColumn(objDataField)
            e.ListBox.DataKeyField = objDataField
            e.ListBox.DataTextField = objDataField
            e.ListBox.DataValueField = objDataField
            e.ListBox.DataBind()
            'radgrid_Dashboard.Rebind()
     
        End Sub
     
        Protected Function GetFilterListDataSetByColumn(ByVal objColumnName As String) As DataSet
            Dim iRadSearchBoxUserId As Integer = ExecuteSqlCmdScalar(String.Format("exec CVS.Get_SpecificUserDetail 'FullName', '{0}','Person_Num','int'", radsearch_UserName.Text))
            Dim qryCmd As String = String.Format("exec CVS.Get_Document_ColumnByUserId '{0}','{1}'", objColumnName, IIf(iRadSearchBoxUserId = 0, ui.PersonNumber, iRadSearchBoxUserId))
            'qryCmd = String.Format("select '{0}'='1'", objColumnName)
            GetFilterListDataSetByColumn = GetDataSet(qryCmd, False)
     
        End Function
     
        Protected Sub radgrid_Dashboard_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles radgrid_Dashboard.ItemCommand
            Dim documentid As String = String.Empty
            Dim ictr As Integer = 0
            Try
                'RadWindowManager1.RadAlert(e.CommandName, 300, 300, "Check", "")
                If ((Not e.CommandName = "Sort") And (Not e.CommandName = "HeaderContextMenuFilter") And (Not e.CommandName = "ChangePageSize")) Then
     
                    'documentid = radgrid_Dashboard.MasterTableView.DataKeyValues(e.CommandArgument)("DocumentId")
                    documentid = radgrid_Dashboard.MasterTableView.DataKeyValues(e.Item.ItemIndex)("DocumentId")
                    Dim script As String = String.Empty
     
                    Select Case e.CommandName
                        Case "OpenSingleTrackerProjectWindow"
                            script = String.Format("function f(){0}OpenTrackerProject(',{2},','{3}'); Sys.Application.remove_load(f);{1}Sys.Application.add_load(f);", "{", "}", documentid, ui.PersonNumber)
                            'ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)
     
                        Case "OpenFromCodeBehind"
                            script = String.Format("function f(){0}OpenRadWin(',{2},'); Sys.Application.remove_load(f);{1}Sys.Application.add_load(f);", "{", "}", documentid)
                            ''RadWindowManager1.RadAlert("DID Search:" + documentid, 300, 300, "Check", "")
                        Case "nothing"
                            'radwindow_TrackerInfo.NavigateUrl = String.Format("http://procmgmt-contentvalidation-dev.bankofamerica.com/TrackerInfo.aspx?did={0}", documentid)
                            'radwindow_TrackerInfo.ReloadOnShow = True
                            'radwindow_TrackerInfo.ShowContentDuringLoad = False
     
                            'script = "function f(){$find(""" + radwindow_TrackerInfo.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
                        Case Else
     
                    End Select
                    If script.Length > 0 Then
                        ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True)
                    End If
     
                End If
            Catch ex As Exception
                Response.Write(String.Format("Error in {0}", System.Reflection.MethodBase.GetCurrentMethod().Name))
            End Try
     
        End Sub
     
     
    #End Region
     
     
    #Region "Command Item Types"
     
     
        Protected Sub radsearch_UserName_Search(sender As Object, e As SearchBoxEventArgs)
            'radgrid_Dashboard.ClientSettings.Virtualization.ItemsPerView = 100
            'If isExport = True Then
            '    radgrid_Dashboard.ClientSettings.Virtualization.ItemsPerView = 60000
            'End If
            If (e.DataItem IsNot Nothing) Then
                Dim di = DirectCast(e.DataItem, Dictionary(Of String, Object))
                load_sidemenu_and_radgrid(di("userid"))
            End If
     
        End Sub
     
        Protected Sub radsearch_UserName_DataSourceSelect(sender As Object, e As Telerik.Web.UI.SearchBoxDataSourceSelectEventArgs)
            Dim src As SqlDataSource = DirectCast(e.DataSource, SqlDataSource)
            Dim searchBox As RadSearchBox = DirectCast(sender, RadSearchBox)
     
            Dim likeCondition As String = String.Format("'{0}' + @filterString + '%'", If(searchBox.Filter = SearchBoxFilter.Contains, "%", ""))
            Dim countCondition As String = If(e.ShowAllResults, " ", " TOP " + (searchBox.MaxResultCount).ToString())
     
            If e.SelectedContextItem IsNot Nothing Then
                likeCondition = String.Format("{0} and GL_FullName={1}", likeCondition, e.SelectedContextItem.Key)
            End If
     
            Dim sSqlCmd As String = "CVS.Get_ManagerList"
     
            src.SelectCommand = sSqlCmd
            src.SelectParameters.Add("whereClause", e.FilterString.Replace("%", "[%]").Replace("_", "[_]"))
     
     
        End Sub
     
     
        Protected Sub ImageButton_Click(sender As Object, e As ImageClickEventArgs)
            isExport = True
     
            'For Each col As Telerik.Web.UI.GridColumn In radgrid_Dashboard.MasterTableView.Columns
            '    radgrid_Dashboard.MasterTableView.GetColumn(col.UniqueName).HeaderStyle.BackColor = Color.Gray
            '    radgrid_Dashboard.MasterTableView.GetColumn(col.UniqueName).HeaderStyle.ForeColor = Color.White
            'Next
     
            'radgrid_Dashboard.MasterTableView.GetColumn("DocumentID").HeaderStyle.BackColor = Color.LightGray
            'radgrid_Dashboard.MasterTableView.GetColumn("Category").ItemStyle.BackColor = Color.LightGray
     
            'radgrid_Dashboard.MasterTableView.GetColumn("GapFlag").Visible = False
            'radgrid_Dashboard.MasterTableView.GetColumn("GapFlag2").Visible = False
            radgrid_Dashboard.MasterTableView.GetColumn("SelectItem").Visible = False
            radgrid_Dashboard.MasterTableView.GetColumn("TitleLink").Visible = False
            radgrid_Dashboard.MasterTableView.GetColumn("TitleExport").Display = True
     
            radgrid_Dashboard.ExportSettings.IgnorePaging = True
            'radgrid_Dashboard.ExportSettings.ExportOnlyData = True
            'clear filters
            'radgrid_Dashboard.MasterTableView.FilterExpression = ""
            'For Each objGridCol As GridColumn In radgrid_Dashboard.Columns
            '    objGridCol.CurrentFilterFunction = GridKnownFunction.NoFilter
            '    objGridCol.CurrentFilterValue = ""
            'Next
            Dim intRowsPerBatch As Integer = TryCast(Session("GridDT"), DataTable).Rows.Count()
            intRowsPerBatch = IIf(intRowsPerBatch < 50, 50, intRowsPerBatch)
            radgrid_Dashboard.ClientSettings.Virtualization.ItemsPerView = intRowsPerBatch
     
     
     
            radgrid_Dashboard.ExportSettings.FileName = String.Format("ManagerDashboard_{1}_{0:MM_dd_yyyy_hhmm}", Now, IIf(String.IsNullOrEmpty(radsearch_UserName.Text.ToString()), ui.UserName, radsearch_UserName.Text))
            radgrid_Dashboard.ExportSettings.OpenInNewWindow = True
            radgrid_Dashboard.MasterTableView.ExportToExcel()
     
        End Sub
     
    #End Region
     
        Protected Sub RadAjaxManager_001_AjaxRequest(sender As Object, e As AjaxRequestEventArgs)
            Dim tstStop As String = String.Empty
            'radgrid_Dashboard.ClientSettings.Virtualization.ItemsPerView =
            'radgrid_Dashboard.PageSize = TryCast(Session("GridDT"), DataTable).Rows.Count()
            'radgrid_Dashboard.Rebind()
        End Sub
    End Class
  2. steve
    steve avatar
    14 posts
    Member since:
    Apr 2016

    Posted 12 Jan 2017 in reply to steve Link to this post

    would love some help on this or just a pointer as to why the data is not refreshing for the radgrid.
  3. Answer
    Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    2466 posts

    Posted 17 Jan 2017 Link to this post

    Hello Steve,

    As documented in the "Limitations" section of the following help article, using template column with Virtualization is not supported scenario, because the initial rendering is performed on server-side, but the next items will be populated on client-side:
    For customizing the content of cells across all items you need to handle the server-side OnItemDataBound event and the client-side OnRowDataBound event.


    Best Regards,
    Konstantin Dikov
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  4. steve
    steve avatar
    14 posts
    Member since:
    Apr 2016

    Posted 17 Jan 2017 Link to this post

    Thank you for the response. I have added the onRowDataBound event to the client-side code and all is well now. I did notice that formatting was not carried over, so I did have to perform a few minor tweaks to the javascript code to have what I needed applied.
Back to Top