Telerik Forums
UI for ASP.NET AJAX Forum
10 answers
795 views
hi
how can i set background=transparent ?
its not fire
thanks
Anbu
Top achievements
Rank 1
 answered on 23 Jan 2013
17 answers
1.8K+ views
Currently, if I populate a combo box with X items, the height of the drop down fits the number of items.  If I provide a list of 1000 items, the drop down makes itself big enough to show all 1000 items.  The only way I have found to limit this is by setting the Height property of the combo box.  However, when I do this I specify something like 300px, but then if I only have 2 items in the list, then I get a big whitespace beneath those 2 items.  Is there something like a "MaxHeight" property that can be set, or a way to make the combo box resize to a certain height?

Thanks
Sara
Sophie
Top achievements
Rank 2
 answered on 23 Jan 2013
5 answers
310 views
Hi

How to give set focus to the content area of the radeditor?
the setfocus method is working in ie but not in chrome.
if i gave the setFocus() it focus on the toolbar(like bold,italic) . not in the content area of editor.
How to give the focus to content area?


thanks in advance. 
geetha.
Jesper Vognsen Laustsen
Top achievements
Rank 2
 answered on 23 Jan 2013
2 answers
709 views
Hi Telerik team,

I have strange problem.

First time page get's loaded with no problem but when I clicked on any page number for paging I got following error:

"Microsoft JScript runtime error: Sys.ArgumentException: Value must not be null for Controls and Behaviors. Parameter name: element"


For paging I am using SetGridData(); method.


Also want to let you know that after commenting following code everything works fine.

 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                                                                <ClientEvents OnRequestStart="onRequestStart" />
                                                                <AjaxSettings>
                                                                    <telerik:AjaxSetting AjaxControlID="rgTemplates">
                                                                        <UpdatedControls>
                                                                            <telerik:AjaxUpdatedControl ControlID="rgTemplates" />
                                                                            <telerik:AjaxUpdatedControl ControlID="RadSplitter1" />
                                                                        </UpdatedControls>
                                                                    </telerik:AjaxSetting>
                                                                    <telerik:AjaxSetting AjaxControlID="btnSearch">
                                                                        <UpdatedControls>
                                                                            <telerik:AjaxUpdatedControl ControlID="rgTemplates" />
                                                                            <telerik:AjaxUpdatedControl ControlID="btnSearch" />
                                                                            <telerik:AjaxUpdatedControl ControlID="RadSplitter1" />
                                                                        </UpdatedControls>
                                                                    </telerik:AjaxSetting>
                                                                </AjaxSettings>
                                                            </telerik:RadAjaxManager>


But I want to AJAXify.


Here is the ASPX code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="myBibles.aspx.cs" Inherits="Debut.myBibles"
    MaintainScrollPositionOnPostback="true" EnableEventValidation="false" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Src="usercontrolls/header.ascx" TagName="header" TagPrefix="uc1" %>
<%@ Register Src="usercontrolls/footer.ascx" TagName="footer" TagPrefix="uc3" %>
<%@ Register Src="usercontrolls/leftmenu.ascx" TagName="leftmenu" TagPrefix="uc4" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">

       <style type="text/css">  
        .AutoHeight  
        {  
            height: auto !important;
        }  
    </style>
    
     <style type="text/css">  
        .AutoHeight1  
        {  
            height: 460px;
        }  
    </style>    

    <title>
        <%# cAppName%>-
        <%# NavGrpMyPrograms%></title>
     
    <link href="css/debutstyle.css" rel="stylesheet" type="text/css" />
    <link href="favicon.ico" rel="shortcut icon" />
    <script language="javascript" src="js/util.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="css/jquery-ui.cache.css" media="all" />
    <script language="javascript" type="text/javascript" src="js/util.js"></script>
    <script language="javascript" type="text/javascript" src="js/jquery-1.6.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/jquery-ui-1.8.17.custom.min.js"></script>
    <script language="javascript" type="text/javascript" src="js/deliverables.js"></script>
    <link href="css/util.css" rel="stylesheet" type="text/css" />

     <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"> 
    <script type="text/javascript">

        function InitAll() {
            $(function () {
                $("#rdPremDtFrom").datepicker({
                    changeMonth: true,
                    changeYear: true
                });
            });
            $(function () {
                $("#rdPremDtTo").datepicker({
                    changeMonth: true,
                    changeYear: true
                });
            });
            $(function () {
                $("#rdSubDtFrom").datepicker({
                    changeMonth: true,
                    changeYear: true
                });
            });
            $(function () {
                $("#rdSubDtTo").datepicker({
                    changeMonth: true,
                    changeYear: true
                });
            });
        }

        function onMyProgramsSort(iCol, iDir) {
            document.getElementById("sortcol").value = iCol;
            document.getElementById("sortdir").value = iDir;
            document.forms[0].submit();
        }

        function onMyTasksSort(iCol, iDir) {
            document.forms[0].txtMyTasksSortCol.value = iCol;
            document.forms[0].txtMyTasksSortDir.value = iDir;
            document.forms[0].submit();
        }


        function datevalidation(frm, to) {

            var ddstrfrm = frm.value;
            var ddstrto = to.value;

            if ((ddstrfrm != "") && (ddstrto != "")) {
                var ddfrm = new Date(ddstrfrm);
                var ddto = new Date(ddstrto);
                if (ddfrm > ddto) {
                    alert('From date must be less than or equal to To date.');
                    to.value = "";
                }

            }

        }
       
    </script>

    </telerik:RadCodeBlock>

     <telerik:RadCodeBlock ID="RadCodeBlock3" runat="server"> 
    <script type="text/javascript">

        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                args.set_enableAjax(false);
            }
        }
       
    </script>
    
    </telerik:RadCodeBlock>

    
      
</head>
<body>
    <form id="frmMyProgram" runat="server">

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
        <script type="text/javascript">
           
            function RadSlidingPane1_Expanding(sender, eventArgs) {
                var slidingZone = $find("<%= SlidingZone1.ClientID %>");

                alert(slidingZone);

                slidingZone.dockPane(sender.get_id());
                eventArgs.set_cancel(true);
            }


            function undocpane(sender, eventArgs) {

                var slidingZone = $find("<%= SlidingZone1.ClientID %>");

                alert(slidingZone);

                var dockedPaneId = slidingZone.get_dockedPaneId();
                var slidingPaneId = document.getElementById("RadSlidingPane1")

                if (slidingPaneId != null && slidingPaneId != dockedPaneId) {
                    slidingZone.undockPane(slidingPaneId.id);
                }
            }


            function SplitterLoaded(splitter, arg) {
                var pane = splitter.getPaneById('<%= Radpane2.ClientID %>');

                alert(pane);

                var height = pane.getContentElement().scrollHeight;
                splitter.set_height(height);
                pane.set_height(height);
            }

</script>

</telerik:RadCodeBlock>

    <script type="text/javascript" src="js/wz_tooltip2.js"></script>
    <script type="text/javascript" src="js/wz_tooltip2.js"></script>
    <asp:HiddenField ID="sortcol" runat="server" Value="" />
    <asp:HiddenField ID="sortdir" runat="server" Value="" />
    <asp:HiddenField ID="txtMyTasksSortCol" runat="server" Value="" />
    <asp:HiddenField ID="txtMyTasksSortDir" runat="server" Value="" />
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse;
        width: 100%;">
        <uc1:header ID="header2" runat="server" />
        <tr>
            <td class="left-nav">
                <uc4:leftmenu ID="leftmenu1" runat="server" />
            </td>
            <td style="padding: 15px" align="left" valign="top">
                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse"
                    width="100%">
                    <tr>
                        <td width="100%">

                            <div id='formattedPrint'>
                                <p class="page-title-program">
                                    <%# NavGrpMyPrograms%>
                                </p>
                                <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
                                    <tr>
                                        <td height="100%">
                                           
                                            <div class="subtitle1">
                                                <asp:Label runat="server" ID="lblhead">Rights Bibles for Approval</asp:Label>
                                            </div>

                                            <div class="body">
                                                <asp:Label runat="server" ID="lblpageinfo">Click on a Program/Episode to view summary information about the program.</asp:Label>
                                            </div>
                                            <table border="0" cellpadding="0" cellspacing="0" 
                                                style="border-collapse: collapse; " width="100%">
                                                <tr>
                                                    <td width="100%" style="height:auto">
                                                        <div id='Div2' style="display: block;">


                                                            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                                                                <ClientEvents OnRequestStart="onRequestStart" />
                                                                <AjaxSettings>
                                                                    <telerik:AjaxSetting AjaxControlID="rgTemplates">
                                                                        <UpdatedControls>
                                                                            <telerik:AjaxUpdatedControl ControlID="rgTemplates" />
                                                                            <telerik:AjaxUpdatedControl ControlID="RadSplitter1" />
                                                                        </UpdatedControls>
                                                                    </telerik:AjaxSetting>
                                                                    <telerik:AjaxSetting AjaxControlID="btnSearch">
                                                                        <UpdatedControls>
                                                                            <telerik:AjaxUpdatedControl ControlID="rgTemplates" />
                                                                            <telerik:AjaxUpdatedControl ControlID="btnSearch" />
                                                                            <telerik:AjaxUpdatedControl ControlID="RadSplitter1" />
                                                                        </UpdatedControls>
                                                                    </telerik:AjaxSetting>
                                                                </AjaxSettings>
                                                            </telerik:RadAjaxManager>


                                                            <telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%"  
                                                                 CssClass="AutoHeight"  onclientload="SplitterLoaded">
                                                                <telerik:RadPane ID="LeftPane" runat="server" Width="15px" Scrolling="none">
                                                                    <telerik:RadSlidingZone ID="SlidingZone1" runat="server" Width="15px" 
                                                                        ClickToOpen="True" Visible="true" Height="100%">
                                                                        <telerik:RadSlidingPane ID="RadSlidingPane1" Title="Search Filters" 
                                                                            runat="server" OnClientExpanding="RadSlidingPane1_Expanding" 
                                                                            Width="215px" >
                                                                                    <table>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblProdCompany" runat="server" Text="Production Company:"></asp:Label><br />
                                                                                                <asp:TextBox CssClass="aspTextBox" ID="txtProdCompany" runat="server"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblSeries" runat="server" Text="Series:"></asp:Label><br />
                                                                                                <asp:TextBox CssClass="aspTextBox" ID="txtSeries" runat="server"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblProgID" runat="server" Text="Program ID:"></asp:Label><br />
                                                                                                <asp:TextBox CssClass="aspTextBox" ID="txtProgID" runat="server"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblProgName" runat="server" Text="Program Name:"></asp:Label><br />
                                                                                                <asp:TextBox CssClass="aspTextBox" ID="txtProgName" runat="server"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblProgType" runat="server" Text="Program Type:"></asp:Label><br />
                                                                                                <asp:DropDownList CssClass="aspDropDownList" ID="ddlProgType" runat="server">
                                                                                                    <asp:ListItem></asp:ListItem>
                                                                                                    <asp:ListItem>Long Form</asp:ListItem>
                                                                                                    <asp:ListItem>Short Form</asp:ListItem>
                                                                                                </asp:DropDownList>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblReviewer" runat="server" Text="Reviewer Name:"></asp:Label><br />
                                                                                                <asp:DropDownList CssClass="aspDropDownList" ID="ddlReviewer" runat="server">
                                                                                                </asp:DropDownList>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblSubmittedDate" runat="server" Text="Submitted Date:"></asp:Label><br />
                                                                                                <asp:TextBox ID="rdSubDtFrom" runat="server" CssClass="aspTextBoxDateFrom"></asp:TextBox>
                                                                                                <asp:Label CssClass="aspLabel0" ID="Label2" runat="server" Text="to"></asp:Label>
                                                                                                <asp:TextBox ID="rdSubDtTo" runat="server" CssClass="aspTextBoxDateTo"></asp:TextBox>
                                                                                            </td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                            <td>
                                                                                                <asp:Label CssClass="aspLabel" ID="lblPremiereDate" runat="server" Text="Premiere Date:"></asp:Label><br />
                                                                                                <asp:TextBox ID="rdPremDtFrom" runat="server" CssClass="aspTextBoxDateFrom"></asp:TextBox>
                                                                                                <asp:Label CssClass="aspLabel0" ID="Label1" runat="server" Text="to"></asp:Label>
                                                                                                <asp:TextBox ID="rdPremDtTo" runat="server" CssClass="aspTextBoxDateTo"></asp:TextBox>
                                                                                                <br />
                                                                                            </td>
                                                                                        </tr>                                                                                       
                                                                                    </table>
                                                                            <table>
                                                                            <tr><td>&nbsp;</td></tr>
                                                                            <tr><td>&nbsp;</td></tr>
                                                                                <tr>
                                                                                    <td style="padding-left:10px;">                                                                                       
                                                                                        <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
                                                                                    </td>
                                                                                </tr>
                                                                            </table>
                                                                        </telerik:RadSlidingPane>
                                                                    </telerik:RadSlidingZone>
                                                                </telerik:RadPane>
                                                                        <telerik:RadPane ID="Radpane2" runat="server" Scrolling="none" >
                                                                           <div style="padding: 1px; width: 99.5%; height: 100%;">
                                                                                <telerik:RadGrid ID="rgTemplates" runat="server" AllowPaging="True" AllowSorting="True"
                                                                                    CellSpacing="0" GridLines="None" Width="99.8%"  AutoGenerateColumns="False"
                                                                                    ShowStatusBar="True" Skin="Office2010Silver" OnPageIndexChanged="rgTemplates_PageIndexChanged"
                                                                                    OnSortCommand="rgTemplates_SortCommand" PageSize="50" 
                                                                                    OnItemCommand="rgTemplate_ItemCommand" CssClass="AutoHeight">
                                                                                    <PagerStyle Mode="NumericPages"></PagerStyle>
                                                                                    <ClientSettings EnableAlternatingItems="False">
                                                                                        <Selecting CellSelectionMode="None" />
                                                                                        <ClientMessages ColumnResizeTooltipFormatString="" />
                                                                                        <Scrolling AllowScroll="false" UseStaticHeaders="false" />
                                                                                        <Resizing AllowColumnResize="false" ShowRowIndicatorColumn="false" />
                                                                                    </ClientSettings>
                                                                                    <AlternatingItemStyle Font-Names="Tahoma" Font-Size="8pt" />
                                                                                    
                                                                                    
                                                                                    <MasterTableView GridLines="Both" CommandItemDisplay="Top" Width="100%">
                                                                                        <CommandItemSettings ExportToPdfText="Export to PDF" ShowExportToExcelButton="true"
                                                                                            ShowAddNewRecordButton="false" ShowRefreshButton="false"></CommandItemSettings>
                                                                                        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                                                                        </RowIndicatorColumn>
                                                                                        <ExpandCollapseColumn Visible="false" FilterControlAltText="Filter ExpandColumn column">
                                                                                        </ExpandCollapseColumn>
                                                                                        <EditFormSettings>
                                                                                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                                                            </EditColumn>
                                                                                        </EditFormSettings>
                                                                                        <HeaderStyle Font-Bold="True" Font-Size="9pt" />
                                                                                    </MasterTableView>

                                                                                    <HeaderStyle BorderColor="#E0E0E0" BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma"
                                                                                        ForeColor="Gray" Height="12px" Font-Bold="True" />
                                                                                    <ItemStyle BorderColor="#E3E8E7" BorderStyle="Solid" BorderWidth="1px" Font-Names="Tahoma"
                                                                                        Font-Size="8pt" />
                                                                                    <FilterMenu EnableImageSprites="False">
                                                                                    </FilterMenu>
                                                                                </telerik:RadGrid>
                                                                          </div>
                                                                        </telerik:RadPane>

                                                            </telerik:RadSplitter>
                                                        </div>

                                                    </td>
                                                </tr>
                                            </table>
                                            <br />
             
                                        </td>
                                    </tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="left-nav">
                &nbsp;
            </td>
            <td>
                <uc3:footer ID="footer2" runat="server" />
            </td>
        </tr>
    </table>
    </form>
</body>

<script language="javascript" type="text/javascript">
    if (document.getElementById('smenu3'))
        document.getElementById('smenu3').style.display = 'none';
    if (document.getElementById('smenu4'))
        document.getElementById('smenu4').style.display = 'none';
</script>
</html>


Here is code behind page:


public partial class myBibles : System.Web.UI.Page
    {
        public string cAppName = string.Empty;
        public string NavGrpMyPrograms = "cNavGrpIndexLogin";
        public string sRequired = string.Empty;
        public string ProductionCompanyDisplayNm = string.Empty;
        public bool RoleSysID = false;
        public string PageDoMyTasks = string.Empty;
        public string PageMyProgramsArchive = string.Empty;
        public string strHelp = string.Empty;
        public string strHelpTitle = string.Empty;
        public int iReviewerSysID = 0;

        dbutils ut = new dbutils();
        constants ct = new constants();
        StringBuilder sb = new StringBuilder();
        HelpPopup hp = new HelpPopup();
        logincheck lc = new logincheck();
        //JG-630
        Reviewer tsInfo = new Reviewer();
        ADPageUserAccess adpa = new ADPageUserAccess();
       String strusersysid = string.Empty;


        protected void Page_Load(object sender, EventArgs e)
        {                    
            if (!ct.CheckSessionExist())
            {
                Response.Redirect(ct.CPagelogin);
            }
            
            if (!IsPostBack)
            {
                SetReviewrCombo();

                //To display the login Reviewers data.
                strusersysid = ct.getSessionInt("UserSysID").ToString();

                if (strusersysid != "")
                {
                    //ddlReviewer.SelectedValue =  strusersysid; // Kim Zena = "2142";
                }
                                                              
                //JG-630.
                //SlidingZone1.DockedPaneId = "RadSlidingPane1";
                setGridHeaders();                
                //loaddata();
                doSearch();
            }
            cAppName = ct.CAppName;
            //ProductionCompanyDisplayNm = ct.getSessionstring("ProductionCompanyDisplayNm");
            RoleSysID = ct.getSessionInt("RoleSysID") != ct.GcAETNReviewer;
            PageDoMyTasks = ct.CPageDoMyTasks;
            
            PageMyProgramsArchive = ct.CPageMyBiblesArchive; //ct.CPageMyProgramsArchive;
            NavGrpMyPrograms = ct.CNavGrpMyPrograms;

            strHelp = hp.displayHelp(HelpPopup.HelpConstants.gcHelpMyPrograms);
            strHelpTitle = hp.displayHelpTitle(true, HelpPopup.HelpConstants.gcHelpMyPrograms);

            //Escape sequence for '.
            strHelp = strHelp.Replace("'", "\\'"); 
   
            rdSubDtFrom.Attributes.Add("onchange", "datevalidation(" + rdSubDtFrom.ClientID + "," + rdSubDtTo.ClientID + ");");
            rdSubDtTo.Attributes.Add("onchange", "datevalidation(" + rdSubDtFrom.ClientID + "," + rdSubDtTo.ClientID + ");");

            rdPremDtFrom.Attributes.Add("onchange", "datevalidation(" + rdPremDtFrom.ClientID + "," + rdPremDtTo.ClientID + ");");
            rdPremDtTo.Attributes.Add("onchange", "datevalidation(" + rdPremDtFrom.ClientID + "," + rdPremDtTo.ClientID + ");");

            btnSearch.Attributes.Add("onclick", "undocpane();");

            ScriptManager.RegisterStartupScript(this, GetType(), "scriptKey", "InitAll();", true);            
       }


        void SetReviewrCombo()
        {
            try 
            {
                DataTable dt = new DataTable();
                dt = ut.getAETNReviewerList10(iReviewerSysID, 1);

                ddlReviewer.DataSource = dt;
                ddlReviewer.DataValueField = "id";
                ddlReviewer.DataTextField = "text";
                ddlReviewer.DataBind();
                ddlReviewer.Items.Insert(0, "");
            }

            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
            }
            
        }
        
        protected void rgTemplates_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            Session.Add("CPI",e.NewPageIndex);
            SetGridData();
        }

        protected void rgTemplates_SortCommand(object sender, GridSortCommandEventArgs e)
        {
            SetGridData();
        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            try
            {
                doSearch();

                SlidingZone1.DockedPaneId = "RadSlidingPane1";
                //RadSlidingPane1
                //SlidingZone1.
               
            }
            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
            }
        }

        
        /// get headers array list for grid from class and sets them
        void setGridHeaders()
        {
            try
            {
                ArrayList al = tsInfo.GetHeaders();
                GridBoundColumn boundColumn;

                foreach (string colhead in al)
                {
                    //Important: first Add column to the collection  
                    boundColumn = new Telerik.Web.UI.GridBoundColumn();
                    this.rgTemplates.MasterTableView.Columns.Add(boundColumn);

                    if (colhead == "Supplier/Production Company")
                    {
                        boundColumn.DataField = "Production_company";
                        //boundColumn.HeaderStyle.Width = Unit.Pixel(260);
                    }
                    else if (colhead == "Series/Specials")
                    {
                        boundColumn.DataField = "Series_name";
                        //boundColumn.HeaderStyle.Width = Unit.Pixel(260);
                    }
                    else if (colhead == "Program ID")
                    {
                        boundColumn.DataField = "Program_ID";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(110);
                        boundColumn.ItemStyle.ForeColor = System.Drawing.Color.Blue;
                        boundColumn.SortExpression = "Prog_ID";
                    }
                    else if (colhead == "Program/Episode")
                    {
                        boundColumn.DataField = "Episode_name";
                        //boundColumn.HeaderStyle.Width = Unit.Pixel(350);
                        boundColumn.ItemStyle.ForeColor = System.Drawing.Color.Blue;
                        boundColumn.SortExpression = "Epi_name";
                    }
                    else if (colhead == "Premiered")
                    {
                        boundColumn.DataField = "Premiere_date";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(105);
                        boundColumn.DataFormatString = "{0: MM/dd/yyyy}";
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }
                    else if (colhead == "Reviewer")
                    {
                        boundColumn.DataField = "Reviewer";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(125);
                    }
                    else if (colhead == "Type")
                    {
                        boundColumn.DataField = "Prog_type";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(95);
                    }
                    else if (colhead == "E&O")
                    {
                        boundColumn.DataField = "EO";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(48);
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }
                    else if (colhead == "MUS")
                    {
                        boundColumn.DataField = "MUS";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(48);
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }
                    else if (colhead == "SS")
                    {
                        boundColumn.DataField = "SS";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(45);
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }
                    else if (colhead == "L&R")
                    {
                        boundColumn.DataField = "LR";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(48);
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }
                    else if (colhead == "Ready")
                    {
                        boundColumn.DataField = "Ready";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(62);
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }

                    else if (colhead == "Submitted")
                    {
                        boundColumn.DataField = "Submit_date";
                        boundColumn.HeaderStyle.Width = Unit.Pixel(110);
                        boundColumn.DataFormatString = "{0: MM/dd/yyyy}";
                        boundColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                        boundColumn.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                    }
                    else
                    {
                        boundColumn.DataField = colhead;
                    }
                    boundColumn.ItemStyle.Font.Name = "Tahoma";
                    boundColumn.ItemStyle.Font.Size = FontUnit.Point(9);
                    boundColumn.HeaderText = colhead;                    
                }

            }
            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
            }
        }


        IList<ReviewerTemplate> GetStoredGridData()
        {
            try
            {
                IList<ReviewerTemplate> allReviewer;
                int iDBAvailability = 0;

                //if (ct.getSessionsObject("reviewtemplate") == null)
                //{

                    allReviewer = ut.getReviewerRequiringTemplates(ref iDBAvailability);
                    if (iDBAvailability == 0)
                    {
                        Response.Redirect(ct.CPageMaintenance, false);
                    }

                    ct.setSessionsObject("reviewtemplate", allReviewer);
                //}
                //else
                //{
                //    allReviewer = (IList<ReviewerTemplate>)ct.getSessionsObject("reviewtemplate");
                //}

                return allReviewer;
            }
            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
                return null;
            }
        }


        void doSearch()
        {
            try
            {
                IList<ReviewerTemplate> allpac = GetStoredGridData();
                IList<ReviewerTemplate> searchallpac = new List<ReviewerTemplate>();

                ////search using LINQ and lambda expressions
                var searchpacs = from s in allpac
                                 select s;

                if (txtProdCompany.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Production_company.ToLower().Contains(txtProdCompany.Text.ToLower()));
                }

                if (txtSeries.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Series_name.ToLower().Contains(txtSeries.Text.ToLower()));
                }
                
                if (txtProgID.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Program_ID.ToLower().Contains(txtProgID.Text.ToLower()));
                }

                if (txtProgName.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Episode_name.ToLower().Contains(txtProgName.Text.ToLower()));
                }

                if (ddlProgType.SelectedItem.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Prog_type.ToLower() == ddlProgType.SelectedItem.Text.ToLower());
                }

                if (ddlReviewer.SelectedItem.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Reviewer.ToLower() == ddlReviewer.SelectedItem.Text.ToLower());
                }


                if (rdSubDtFrom.Text != "")
                {                    
                    searchpacs = searchpacs.Where(r => r.Submit_date >= Convert.ToDateTime(rdSubDtFrom.Text));
                }

                if(rdSubDtTo.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Submit_date <= Convert.ToDateTime(rdSubDtTo.Text));
                }
               
                if (rdPremDtFrom.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Premiere_date >= Convert.ToDateTime(rdPremDtFrom.Text));
                }

                if (rdPremDtTo.Text != "")
                {
                    searchpacs = searchpacs.Where(r => r.Premiere_date <= Convert.ToDateTime(rdPremDtTo.Text));
                }
                                            
                foreach (ReviewerTemplate q in searchpacs)
                {
                    searchallpac.Add(q);
                }


                rgTemplates.MasterTableView.CurrentPageIndex = 0;

                this.rgTemplates.DataSource = searchpacs;

                if (searchallpac.Count < 70 && searchallpac.Count > 0)
                {
                    this.rgTemplates.PageSize = searchallpac.Count;
                }
                else
                {
                    this.rgTemplates.PageSize = 50;
                }

                //if (searchallpac.Count > 0)
                //{
                //    RadSplitter1.Attributes.Add("class", "AutoHeight");
                //    Radpane2.Attributes.Add("class", "AutoHeight");
                //    LeftPane.Attributes.Add("class", "AutoHeight");

                //    //RadSplitter1.CssClass = "AutoHeight";
                //    //Radpane2.CssClass = "AutoHeight";
                //    //LeftPane.CssClass = "AutoHeight";
                //}
                //else
                //{
                //    RadSplitter1.Height = new Unit(460);
                //}

                //this.rgTemplates.PageSize = 50;

                //this.rgTemplates.CssClass = "AutoHeight";
                //RadSplitter1.CssClass = "AutoHeight";

                if (searchallpac.Count == 0 || searchallpac.Count <= 17 )
                {
                    RadSplitter1.CssClass = "AutoHeight1";
                    Radpane2.CssClass = "AutoHeight1";
                    rgTemplates.CssClass = "AutoHeight1";
                }
                else
                {
                    RadSplitter1.CssClass = "AutoHeight";
                    Radpane2.CssClass = "AutoHeight";
                    rgTemplates.CssClass = "AutoHeight";
                }

                this.rgTemplates.Rebind();

                ct.setSessionsObject("reviewtemplate", searchallpac);
            }
            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
            }
        }


        protected void rgTemplate_ItemCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                if (e.CommandName == RadGrid.ExportToExcelCommandName ||
                    e.CommandName == RadGrid.ExportToWordCommandName ||
                    e.CommandName == RadGrid.ExportToCsvCommandName)
                {
                    rgTemplates.ExportSettings.ExportOnlyData = true;
                    rgTemplates.ExportSettings.IgnorePaging = true;
                    rgTemplates.ExportSettings.OpenInNewWindow = true;
                    rgTemplates.ExportSettings.FileName = "MyBibles";
                    rgTemplates.MasterTableView.ExportToExcel();
                   
                    //Hide the image column "Ready".
                    rgTemplates.MasterTableView.GetColumn("Ready").Visible = false;
    
                    //For Export to Excel.
                    SetGridData();
                }

            }
            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
            }
            
        }


        void SetGridData()
        {
            try
            {
                IList<ReviewerTemplate> mybible = new List<ReviewerTemplate>();

                if (ct.getSessionsObject("reviewtemplate") != null)
                {
                    mybible = (IList<ReviewerTemplate>)ct.getSessionsObject("reviewtemplate");
                }

                //Get the last PAgeindex.
                int getPageindex = 0;
                getPageindex = mybible.Count / rgTemplates.PageSize;

                if (getPageindex == Convert.ToInt16(HttpContext.Current.Session["CPI"]))
                {
                    RadSplitter1.CssClass = "AutoHeight1";
                    Radpane2.CssClass = "AutoHeight1";
                    rgTemplates.CssClass = "AutoHeight1";
                }
                else 
                {
                    RadSplitter1.CssClass = "AutoHeight";
                    Radpane2.CssClass = "AutoHeight";
                    rgTemplates.CssClass = "AutoHeight";
                }

                this.rgTemplates.DataSource = mybible;
                Session.Remove("CPI");
            }
            catch (Exception ex)
            {
                ut.WritetoLog(ex.ToString());
            }
        }

    }




Please help me.


Thanks & Regards
Shirish
Shirish
Top achievements
Rank 1
 answered on 23 Jan 2013
2 answers
161 views
How can we get accurate numbers out for aggregates applied to a grid with virtual paging enabled?

I've recently switched over a grid to virtual paging.  Before, the code would just select everything and let the control work out what to display and how to deal with groups and aggregates.  However, many of my customers were running into issues (understandably) with large tables - those containing a few hundred thousand or more.  The grid was taking forever to display / group / page / etc.

Now, the grid is very high performance, thanks to the new MSSQL 2012 OFFSET... FETCH NEXT statement - it's about time they implemented that!  While it's high performance, i've now lost the ability to do grouping and aggregates correctly.  It will only summarize what is on the current page.  Certainly that makes sense - there's no way for the telerik grid to read data it hasn't been handed.

So - how do i correct this?  I don't need a full-blown example, but rather just a quick push in the right direction.  Is there a function i can override to deal with the groups / aggregates manually?  Is that the right choice?  Any help here would be appreciated!

Thanks!

-RP
Justavian
Top achievements
Rank 1
 answered on 23 Jan 2013
7 answers
280 views
Hello,

System: ASP.NET AJAX 2012.2.607.40

In previous version of RadRibbonBar, it was possible to let it to follow the width of the parent component, even with the window itself, by setting its Width="100%".
This doesn't work anymore with the new version of RadRibbonBar.
Any workarounds exist?

Best regards,
Alain
Ivan Zhekov
Telerik team
 answered on 23 Jan 2013
8 answers
235 views
Hi, there is a way to hide the hours in the scheduler, from for example 11 pm to 7 am? i want show only the day

Thanks
TT
Top achievements
Rank 1
 answered on 23 Jan 2013
1 answer
111 views

Hi:

I have a a problem; I have a grid with select column , and when a want to select all the records I receive this error: "Stop running this script?", my grid has about 2300 records, when the number of records is less I dont have this problem, I try using the paging but when i want to select all records this accion only select the records from the selected page.

What can I do????

Pavlina
Telerik team
 answered on 23 Jan 2013
2 answers
95 views
Can we develop desktop applications using html5 & telerik ?
Bhuvan
Top achievements
Rank 1
 answered on 23 Jan 2013
3 answers
291 views
In my grid table view, I want to have my last column to take the span of all the rows in the tableview.

In order to do this, I need to be able to loop through all the rows of the gridtableview but when I try the following in my DetailTableDataBind : 

e.DetailTableView.Items.Count

it always returns 0.

What can I do in order to achieve this?

Thanks

Maxime
Top achievements
Rank 1
 answered on 23 Jan 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?