Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
178 views
Hi

i have a .js file to control when a user close the browser tab then destroy all session on the server.
This control when not fire when change the page with a link 'a' or submit a form else the control will fire.

I have a listbox ajaxed and when i click an item my cotrol fire and destroy all session... disaster...

its possible to bind all ajax avent for block the destroy session?

my js.file
======================================
var validNavigation = false;

/* No HTML output is returned*/
function endSession() {
    //$.get("../logout.aspx");
    alert("MedOFFICEweb - Sessione terminata.");
    validNavigation = false
}

function wireUpEvents() {

    /*
    * For a list of events that triggers onbeforeunload on IE
    * check http://msdn.microsoft.com/en-us/library/ms536907(VS.85).aspx
    */

    window.onbeforeunload = function() {       
            if (!validNavigation) {
                endSession();
            }                                  
    }

 
        
    // Attach the event click for all links in the page
    $("a").bind("click", function() {
    validNavigation = true;
        //alert("a")
    });

    // Attach the event submit for all forms in the page
    $("form").bind("submit", function() {
    validNavigation = true;
        //alert("form")
    });

 }

// Wire up the events as soon as the DOM tree is ready
$(document).ready(function() {    
    wireUpEvents();
});
===========================================



 
Fabio
Top achievements
Rank 2
 answered on 23 Dec 2010
1 answer
114 views
Hello Telerik,

I am new to Rad Controls.  I am trying to assign different data sources to different chart series in one Rad Chart but i couldn't able to find solution for that. So can you help me figure out this issue.

Here is  my problem description

I need to display bar series and line series in one Rad Chart and both series need to display different data sets.

Thanks
Swetha
Ves
Telerik team
 answered on 23 Dec 2010
2 answers
111 views
Hi Forum,
Please assist, I am creating the Radgrid programmatically and want to add Radcombox as a filtering item to it. 
 No Clue, and I've tried everything I can find. 
I want the design output like the attached file.

Bali.

here is the code i am using

     rdGrd = new RadGrid();
            rdGrd.AutoGenerateColumns = false;
            rdGrd.AllowPaging = true;           
            rdGrd.AllowSorting = true;
            rdGrd.AllowFilteringByColumn = true;     

            rdGrd.Width = Unit.Pixel(600);
            rdGrd.EnableAJAX = true;
            rdGrd.EnableAJAXLoadingTemplate = true;
            rdGrd.Skin = "None";
                      
            rdGrd.NeedDataSource += new GridNeedDataSourceEventHandler(rdGrd_NeedDataSource);
            rdGrd.ItemDataBound += new GridItemEventHandler(rdGrd_ItemDataBound);
            rdGrd.PageSize = 25;
            rdGrd.ID = "grd";

  GridBoundColumn boundColumn1 = new GridBoundColumn();
                boundColumn1.DataField = "FirmName";
                boundColumn1.UniqueName = "Firm";
                boundColumn1.HeaderText = "Firm";
                boundColumn1.AllowFiltering = true;                
                boundColumn1.HeaderStyle.HorizontalAlign = HorizontalAlign.Center;
                boundColumn1.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
                boundColumn1.ItemStyle.VerticalAlign = VerticalAlign.Top;

  //HOW CAN I ADD A RADCOBOBOX HERE AS A FILTERING ITEM

  GridTemplateColumn templateColumnRank = new GridTemplateColumn();
                templateColumnRank.AllowFiltering = false;
                templateColumnRank.HeaderTemplate = new NColHeaderTemplate(120, "Rank", "cont3", "2009, 2008", "LeaderRank, LeaderRankM1", "cont4, cont5");
                templateColumnRank.ItemTemplate = new NColItemTemplate(120, "LeaderRank, LeaderRankM1", "cont1, cont2");

 

  rdGrd.MasterTableView.Columns.Add(templateColumnRank);
                rdGrd.MasterTableView.Columns.Add(boundColumn1);
  
     this.Controls.Add(rdGrd);

 

public class NColHeaderTemplate : ITemplate
    {
        protected LiteralControl lControl0;
        private int iColumnWidth;
        private int nColHeader;
        private string sTopLevelColumnName;
        private string sTopLevelColumnNameUniqueID;
        private string[] sNBottomColumnName;
        private string[] sNBottomColSortCommandArgument;
        private string[] sNBottomColumnNameUniqueID;
        private string sCellHorizontalAlign;

        public NColHeaderTemplate(int ColumnWidth, string TopLevelColumnName, string TopLevelColumnNameUniqueID, string NBottomColumnName, string NBottomColSortCommandArgument, string NBottomColumnNameUniqueID)
        {
            iColumnWidth = ColumnWidth;
            sTopLevelColumnName = TopLevelColumnName.Trim();
            sTopLevelColumnNameUniqueID = TopLevelColumnNameUniqueID.Trim();
            sNBottomColumnName = NBottomColumnName.Split(Convert.ToChar(","));
            sNBottomColSortCommandArgument = NBottomColSortCommandArgument.Split(Convert.ToChar(","));
            sNBottomColumnNameUniqueID = NBottomColumnNameUniqueID.Split(Convert.ToChar(","));
            //ColHeaderParam = nColHeaderParam.Split(Convert.ToChar(","));
            nColHeader = sNBottomColumnName.Length;
            sCellHorizontalAlign = "Center";
        }

       
        public void InstantiateIn(System.Web.UI.Control container)
        {
            lControl0 = new LiteralControl();
            lControl0.ID = sTopLevelColumnNameUniqueID;
            lControl0.Text = sTopLevelColumnName;

            Table table = new Table();
            table.Width = Unit.Pixel(iColumnWidth);

            TableRow row1 = new TableRow();
            TableRow row2 = new TableRow();

            TableCell cell11 = new TableCell();
           
            cell11.Controls.Add(lControl0);
            cell11.ColumnSpan = nColHeader;

            row1.Cells.Add(cell11);
            table.Rows.Add(row1);

            for (int i = 0; i < nColHeader; i++)
            {

                LinkButton lbControl = new LinkButton();
                lbControl.ID = sNBottomColumnNameUniqueID[i].ToString().Trim();
                lbControl.Text = sNBottomColumnName[i].ToString().Trim();
                lbControl.CommandName = "Sort";
                lbControl.CommandArgument = sNBottomColSortCommandArgument[i].ToString().Trim();

                TableCell cell = new TableCell();
                cell.HorizontalAlign = HorizontalAlign.Center
               
                cell.Controls.Add(lbControl);
                cell.Width = iColumnWidth / nColHeader;
                row2.Cells.Add(cell);

            }

            table.Rows.Add(row2);
            container.Controls.Add(table);
        }
    }

    public class NColItemTemplate : ITemplate
    {

        //protected LiteralControl lControl;
        protected HyperLink lControl;
        private int iColumnWidth;
        private int nColItem;
        private string[] sNBottomDataColumnName;
        private string[] sNBottomDataControlUniqueID;
        private string sBottomDataColumnName;
        private string sCellHorizontalAlign;
       

        public NColItemTemplate(int ColumnWidth, string NBottomDataColumnName, string NBottomDataControlUniqueID)
        {
            sNBottomDataColumnName = NBottomDataColumnName.Split(Convert.ToChar(","));
            sNBottomDataControlUniqueID = NBottomDataControlUniqueID.Split(Convert.ToChar(","));
            nColItem = sNBottomDataColumnName.Length;
            iColumnWidth = ColumnWidth;
            sCellHorizontalAlign = "Center";
        }
       
        public void InstantiateIn(System.Web.UI.Control container)
        {
            Table table = new Table();
            table.Width = Unit.Pixel(iColumnWidth);

            TableRow row1 = new TableRow();
            for (int i = 0; i < nColItem; i++)
            {
                //lControl = new LiteralControl();
                lControl = new HyperLink();
                lControl.ID = sNBottomDataControlUniqueID[i].Trim();
                lControl.Text = sNBottomDataColumnName[i].ToString().Trim();
                lControl.DataBinding += new EventHandler(lControl_DataBinding);

                TableCell cell = new TableCell();
                cell.HorizontalAlign = HorizontalAlign.Center;
                cell.VerticalAlign = VerticalAlign.Top;
               

                cell.Width = iColumnWidth / nColItem;
                cell.Controls.Add(lControl);
                row1.Cells.Add(cell);
            }
            table.Rows.Add(row1);
            container.Controls.Add(table);
            container.Controls.Add(new LiteralControl("<br />"));
        }
        public void lControl_DataBinding(object sender, EventArgs e)
        {
           // LiteralControl l = (LiteralControl)sender;
            HyperLink l = (HyperLink)sender;
            GridDataItem container = (GridDataItem)l.NamingContainer;
            sBottomDataColumnName = l.Text.Trim();
            l.Text = ((DataRowView)container.DataItem)[sBottomDataColumnName].ToString();
            l.Target = "_blank";
            l.NavigateUrl = "http://www.google.com/search?hl=en&q=" + ((DataRowView)container.DataItem)[sBottomDataColumnName].ToString() + "&btnG=Google+Search";

        }

 

    }

Bali
Top achievements
Rank 1
 answered on 23 Dec 2010
3 answers
227 views
Hi,

I have a radgrid with dynamic GridBoundColumns created, where we apply custom format string to each of them based on data type
eg: boundColumn.DataFormatString = "{0:N}" for decimal or any number type.

I have support for both server-side and client-side aggregate functionality. But facing some issues now.

Scenario : If we apply a custom DataFormatString to a column
Grid is loaded fine. But if user selects a aggregate type using Footer Aggregate Menu from Column Header, Aggregate Name is not displayed within the footer result.

Aggregate Operation is executed fine and desired result is displayed but we are not able to see the Aggregate name.

Eg: We apply “Count” aggregation on Column1 then the footer result is displayed as “x.
 The expected result should be “Count : x”

It works fine when no dataformat string is applied on bound columns. 

Here is a post which says , which in-turn says aggregate title names can be turned off by seting DataFormatString.
http://stackoverflow.com/questions/1244894/telerik-radgrid-custom-aggregate-unwanted-text

So in our case, its the same that is happening. We are setting the dataformatstring and cant see the aggregate titles.

Need a solution to get this working.
Are there any specific constraints to use in order to support both server side and client side aggregates with formats applied ? Or am I missing anything here ?

Any thoughts ?
Martin
Telerik team
 answered on 23 Dec 2010
5 answers
789 views
Hello,

In the RadDatePicker control I've set MaxDate/MinDate and ValidationGroup, but I am still able to submit form with invalid date.

Using following example I am able to submit form with "AA" text or "1/1/2020" date in the RadDatePicker. I've tried solution with raddatepicker validation but it doesn't work when user presses Enter - form is submitted.

Please check my example.

<%@ Page Language="C#" AutoEventWireup="true" %> 
 
<%@ 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 runat="server"
  <title>Untitled Page</title> 
</head> 
<body> 
 
  <script runat="server"
    protected void Button1_Click(object sender, EventArgs e) 
    { 
      Title = "ok"
    } 
  </script> 
 
  <form id="form1" runat="server"
  <telerik:RadScriptManager runat="server"
  </telerik:RadScriptManager> 
  <telerik:RadDatePicker ID="RadDatePicker1" runat="server" MaxDate="2010-12-31"
    <DateInput runat="server" InvalidStyleDuration="100" ValidationGroup="Test"
    </DateInput> 
  </telerik:RadDatePicker> 
  <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" ValidationGroup="Test" /> 
  </form> 
</body> 
</html> 

My configuration:
  • VS 2008
  • Telerik For ASP.NET AJAX (Telerik.Web.UI.dll Version=2008.1.619.35)
  • IE 7.0
  • Firefox 3.0

Best regards, Oleg.
Arash
Top achievements
Rank 1
 answered on 23 Dec 2010
7 answers
219 views
Does anyone have any advice on Radscheduler functionality on Iphone using Safari or Opera Mini? Iphone does not allow for a double click on a cell, has anyone had to tackle this with their customers, and how did you solve it?


Thanks,
Kamen Bundev
Telerik team
 answered on 23 Dec 2010
1 answer
44 views

Posted 0 minutes ago (permalink)

1. i have tree with about 4 levels
the first level i get from server code and the other
by webservice.

in the begining i just recieve
the first level
i know from advanced what is their checked property
some are:

  • 0 - Unchecked
  • 1 - Checked
  • 2 - Indeterminate

    how can i set these values by code ,when the component can't make it itself
    , because it doesn't have childs yet (until i click on some of the first level and recive by webservice their childs. the second level)

    2. one more problem is that tri state doesn't work properly. example: one of the three childs isn't checked, the father of it, the second level is Indeterminate but the first level is Checked  instead of Indeterminate 

  • Nikolay Tsenkov
    Telerik team
     answered on 23 Dec 2010
    8 answers
    492 views
    Hi -

    I have:
    Installed AJAX
    Installed RadControls_for_ASP.NET_AJAX_2010_1_519_dev.msi
    Added a RadGrid to a web part
    Complied and deployed using VS 2010

    On runtime I get:

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Could not load file or assembly 'Telerik.Web.UI' or one of its dependencies. The system cannot find the file specified.

    Source Error:

    Line 7:  <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    Line 8:  <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SubmittalUserControl.ascx.cs" Inherits="Tribridge_PM_Portal.Submittal.SubmittalUserControl" %>
    Line 9: <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>Line 10: 
    Line 11: <script type="text/javascript" language="javascript">

    Source File: /_CONTROLTEMPLATES/Tribridge_PM_Portal/Submittal/SubmittalUserControl.ascx    Line: 9

    Assembly Load Trace: The following information can be helpful to determine why the assembly 'Telerik.Web.UI' could not be loaded.

    WRN: Assembly binding logging is turned OFF.
    To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
    Note: There is some performance penalty associated with assembly bind failure logging.
    To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
    

    One issue may be that I do not see two required dll's in the GAC.

    Telerik.Ajax.SharePoint.dll and RadEditorSharePoint.dll.

    I do not see these anywhere in the Rad install path or on my hard drive either.

    Please advise where these are located.

    I noticed when I ran the Telerik installer it did not update the GAC or sp web.config either.

    Thank you.




    Sebastian
    Telerik team
     answered on 23 Dec 2010
    1 answer
    70 views
    Hi,

    I am using hierarchical grids in my page. The child grid is expanding on click of parent link, but the right side part of the child grid is missing.  This behaviour is not consistant always, some times its showing the full sub grid. Please refer the attached screen shots for reference.


    Regards,
    Chandrababu.
    Iana Tsolova
    Telerik team
     answered on 23 Dec 2010
    13 answers
    417 views
    I am developing prototype using telerik rad controls. One of my requirement is to display a radgrid dynamically inside a radwindow  which comes up as a new pop window, on hyperlink click event. There is an additional radgrid on the page. I would then want to drag a row from the dynamically created radgrid(inside radwindow) into existing radgrid on the same page.
    I know that radwindow can be used as container for containing controls from same page but I want to the radwindow as new pop up on same page and then I can refer Id's of both radgrid controls while drag and drop.

    Kindly reply
    Neerav Patel
    Nikolay Tsenkov
    Telerik team
     answered on 23 Dec 2010
    Narrow your results
    Selected tags
    Tags
    +? more
    Top users last month
    Rob
    Top achievements
    Rank 3
    Bronze
    Bronze
    Iron
    Sergii
    Top achievements
    Rank 1
    Iron
    Iron
    Dedalus
    Top achievements
    Rank 1
    Iron
    Iron
    Lan
    Top achievements
    Rank 1
    Iron
    Doug
    Top achievements
    Rank 1
    Want to show your ninja superpower to fellow developers?
    Top users last month
    Rob
    Top achievements
    Rank 3
    Bronze
    Bronze
    Iron
    Sergii
    Top achievements
    Rank 1
    Iron
    Iron
    Dedalus
    Top achievements
    Rank 1
    Iron
    Iron
    Lan
    Top achievements
    Rank 1
    Iron
    Doug
    Top achievements
    Rank 1
    Want to show your ninja superpower to fellow developers?
    Want to show your ninja superpower to fellow developers?