Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
223 views
Hi,
 Based on certain criteria Im binding items in RadMenu, in which am supposed to populate the RadTreeView inside one of the RadMenuItem (named "Tools") dynamically. Ive done this using ItemDataBound of RadMenu. (below is the Code)  :      
protected void TopMenu_ItemDataBound(object sender, RadMenuEventArgs e)
{
    if (!string.IsNullOrEmpty(e.Item.NavigateUrl))
        e.Item.Attributes["onclick"] = "return Redirect(this.href);";
 
    if (e.Item.Text.ToLower() == "Tools".ToLower())
    {
        RadMenuItem radTools = new RadMenuItem();
 
        RadTreeView radToolTreeView = new RadTreeView();
        radToolTreeView.DataTextField = "Text";
        radToolTreeView.DataFieldID = "MenuID";
        radToolTreeView.DataFieldParentID = "ParentID";
        radToolTreeView.DataNavigateUrlField = "Url";
        radToolTreeView.LoadingMessage = "Loading...";               
        radToolTreeView.Skin = "Web20";
        radToolTreeView.CssClass = "MenuTreeView";   
        radToolTreeView.DataSource = BindToolMenu1();
        radToolTreeView.BackColor = System.Drawing.Color.Aqua;   
        radToolTreeView.DataBind();
        radToolTreeView.ExpandAllNodes();
        radTools.Controls.Add(radToolTreeView);
 
        e.Item.Items.Add(radTools);
    }
}

from the above code, I am able to set the attributes for RadMenuItem

e.Item.Attributes["onclick"] = "return Redirect(this.href);";

I need to set the same attribute on clicking on TreeViewNode. Please tell me how to do this?

Thanks in advance
KSP
Prabhu
Top achievements
Rank 1
 answered on 20 Mar 2012
1 answer
131 views
I'm hoping someone can help me by either pointing me to a straight forward example or pointing out the error(s) in my code.  I'm attempting to provide history points when a user is interacting with an ajax grid.  I've started just with paging but eventually want to get this working with sorting as well.  

I have a master page which defines a RadScriptManager:

<telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePartialRendering="true" EnableHistory="true" EnableSecureHistoryState="false"></telerik:RadScriptManager>

On a content page I have a ScriptManagerProxy to invoke the OnNavigate event (when a browser back/forward button is clicked):

<asp:ScriptManagerProxy ID="ProxyScriptManager" runat="server" OnNavigate="ScriptManager_OnNavigate" />

The ScriptManager_OnNavigate handler is defined as such:

protected void ScriptManager_OnNavigate(object sender, HistoryEventArgs e)
        {
            if (e.State.Count <= 0)
            {
                // setup default state
                RadGrid1.MasterTableView.CurrentPageIndex = 0;
                RadGrid1.Rebind();
                return;
            }
  
            string key = e.State.AllKeys[0];
            string state = string.Empty;
  
            if (string.Equals(key, GridPageHistoryKey))
            {
                state = e.State[key];
                int pageIndex;
                if (int.TryParse(state, out pageIndex))
                {
                    RadGrid1.MasterTableView.CurrentPageIndex = pageIndex;
                    RadGrid1.Rebind();
                }
            }
  
  
        }

On the grid's OnPageIndexChanged event handler, I set a private variable to true which is then checked in the grids OnPrerender event:

protected void RadGrid1_PageIndexChanged(object sender, GridPageChangedEventArgs e)
        {
            _saveState = true;
        }

protected void RadGrid1_PreRender(object sender, EventArgs e) {
if (_saveState)
            {
                if (RadScriptManager.GetCurrent(this.Page).IsInAsyncPostBack && !RadScriptManager.GetCurrent(this.Page).IsNavigating)
                {
                    var state = RadGrid1.MasterTableView.CurrentPageIndex.ToString();
                    RadScriptManager.GetCurrent(this.Page).AddHistoryPoint(GridPageHistoryKey, state);
                } 
            }

It appears that the add history point is getting created and the OnNavigate code is executing but the grid doesn't update when clicking the back button.  Am I missing a crucial step?  Is there an example that doesn't just point me to:  http://www.telerik.com/help/aspnet-ajax/ajax-back-forward-btns.html 

Thanks for any help!

Walter
Top achievements
Rank 1
 answered on 20 Mar 2012
1 answer
68 views

Server Error in '/' Application.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

Source Error:

Line 21: 		if (!IsPostBack)
Line 22: 		{
Line 23: 			RadGrid1.Rebind();
Line 24: 			SelectFirstGridRow();
Line 25: 		}

Source File: d:\Test_telerik\WebMail\Default.aspx.cs    Line: 23




Could you please to help
Tsvetina
Telerik team
 answered on 20 Mar 2012
4 answers
96 views
We are having a form section with a vertical scroll. We have placed a Rad Textbox at the top. We have noticed that when IE renders in IE 7.0 compatibility mode (default mode for Intranet sites), the textbox stays fixed when user scrolls.

I've pasted the sample code below:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="RadControlsWebApp1.WebForm2" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
    <style type="text/css">
        body
        {
            font-family: Arial, Helvetica, Sans-Serif;
            font-size: 11pt;
            color: Black;
        }
          
        div.MasterContainer
        {
            width: 600px;
            height: 400px;
            padding: 0px;
            margin: auto;
        }
          
        div.FormContainer
        {
            width: 95%;
            margin: 0px;
            padding: 0px;
            border-style: solid;
            border-width: 1px;
            border-color: Black;
            border-collapse: collapse;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.        
    </script>
    <div class="MasterContainer">
        <div style="width: 100%; height: 150px; overflow: auto;">
            <div class="FormContainer">
                <telerik:RadTextBox ID="txtTab2Title" runat="server" EmptyMessage="Enter Something Here"
                    Label="Enter:" Width="250px">
                </telerik:RadTextBox>
            </div>
            <div style="width: 95%; margin-top: 10px;">
                Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis
                egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet,
                ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est.
                Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra.
                Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean
                fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus
                lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent
                dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna
                eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor,
                facilisis luctus, metus
            </div>
        </div>
    </div>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    </form>
</body>
</html>

mosswgreentea
Top achievements
Rank 1
 answered on 20 Mar 2012
1 answer
57 views
I am trying to filter a GridDateTimeColumn that has the the DataFormatString = "{0:MM/dd/yyyy hh:mm tt}" and PickerType ="DatePicker"

The DataField = "ReferralDate" which is a Nullable<DateTime> property on my business object.

I would like to filter on date and simply ignore the time.  For example if the data in the grid contains:

3/11/2012 3:23 PM
1/4/2011 12:00 AM
3/11/2012 12:00 PM

Applying the filter "3/11/12" "EqualTo" will produce the following:

3/11/2012 3:23 PM
3/11/2012 12:00 PM

 I've been looking through the forums for a solution and found lots of posts related to GridDateTimeColumns and filtering which I'm finding to be either incomplete as far as a solution goes or not really applying to my specific need.  Any help/direction would be appreciated!
Jayesh Goyani
Top achievements
Rank 2
 answered on 20 Mar 2012
1 answer
52 views
Hello all,

Can someone point me to some examples of how to develop an online form capturing basic information of a user?

Ideally I would like to use all the Radcontrols and AJAX.

I am developing this to link in with a CRM system.

Thanks
Marin
Telerik team
 answered on 20 Mar 2012
1 answer
408 views
I've noticed after updating several sites to the newest hot fix version, and adjusting the Script Manager on the page to include the telerik's Jquery core Module. that $telerik is alot cleaner, easier to use and just generally better than the methods used in the tutorials and help files (eg. $find('Controlname');)

is there a reason we shouldn't be using the $telerik, are there situations where one shouldn't concisder this (like where Jquery isn't loaded or used) i'm at a loss for other situations where it's use would cuase issues.

I understand it takes time to update documentation. that's not really the point.

Slav
Telerik team
 answered on 20 Mar 2012
3 answers
159 views
hi

if user enter any url like www.google.com  in Radeditor it is getting anchor tag in html view.how to disable this one.

Thanks and Regards
Srikanth
<telerik:RadEditor ID="txtMessage" runat="server" Height="200px" Width="470px" Skin="Office2007"
                                                                    DialogHandlerUrl="Telerik.Web.UI.DialogHandler.axd" TabIndex="3" OnClientLoad="OnClientLoad"
                                                                    ContentFilters="MakeUrlsAbsolute,FixEnclosingP,IECleanAnchors "  >
                                                                    <RealFontSizes>
                                                                        <telerik:EditorRealFontSize Value="1pt" />
                                                                        <telerik:EditorRealFontSize Value="2pt" />
                                                                        <telerik:EditorRealFontSize Value="3pt" />
                                                                        <telerik:EditorRealFontSize Value="4pt" />
                                                                        <telerik:EditorRealFontSize Value="5pt" />
                                                                        <telerik:EditorRealFontSize Value="6pt" />
                                                                        <telerik:EditorRealFontSize Value="7pt" />
                                                                        <telerik:EditorRealFontSize Value="8pt" />
                                                                        <telerik:EditorRealFontSize Value="9pt" />
                                                                        <telerik:EditorRealFontSize Value="10pt" />
                                                                        <telerik:EditorRealFontSize Value="11pt" />
                                                                        <telerik:EditorRealFontSize Value="12pt" />
                                                                        <telerik:EditorRealFontSize Value="13pt" />
                                                                    </RealFontSizes>
                                                                    <Tools>
                                                                        <telerik:EditorToolGroup>
                                                                            <telerik:EditorTool Name="FindAndReplace" />
                                                                            <telerik:EditorSeparator />
                                                                            <telerik:EditorTool Name="Undo" />
                                                                            <telerik:EditorTool Name="Redo" />
                                                                            <telerik:EditorSeparator />
                                                                            <telerik:EditorTool Name="Cut" />
                                                                            <telerik:EditorTool Name="Copy" />
                                                                            <telerik:EditorTool Name="Paste" />
                                                                        </telerik:EditorToolGroup>
                                                                        <telerik:EditorToolGroup>
                                                                            <telerik:EditorTool Name="Bold" />
                                                                            <telerik:EditorTool Name="Italic" />
                                                                            <telerik:EditorTool Name="Underline" />
                                                                            <telerik:EditorSeparator />
                                                                            <telerik:EditorTool Name="ForeColor" />
                                                                            <telerik:EditorTool Name="BackColor" />
                                                                            <telerik:EditorSeparator />
                                                                            <telerik:EditorTool Name="FontName" />
                                                                            <telerik:EditorTool Name="RealFontSize" />
                                                                        </telerik:EditorToolGroup>
                                                                    </Tools>
                                                                   
                                                                </telerik:RadEditor>
Rumen
Telerik team
 answered on 20 Mar 2012
4 answers
79 views
I'm creating a line chart with multiple series created dynamically.

Here is the code.

For Each mdItem As ModalityTrendWrapper In ModalityTrend
            Dim newSeries As New Telerik.Charting.ChartSeries()
            newSeries.Name = mdItem.Modality
            newSeries.Type = ChartSeriesType.Line
             
            For Each dateCount As ModalityTrendItem In mdItem.DateCounts
                Dim chrItem As New ChartSeriesItem()
                chrItem.YValue = dateCount.Count
                chrItem.Name = dateCount.Modality
                chrItem.Label.TextBlock.Text = dateCount.Count
                chrItem.ActiveRegion.Tooltip =dateCount.Modality
                newSeries.Items.Add(chrItem)
            Next
 
 
            RadChart1.Series.Add(newSeries)
        Next
         
        Dim MaxValue As Integer = Enumerable.Range(0, CInt(ModalityTrend.Count)).Select(Function(ex) ModalityTrend(ex).DateCounts.Max(Function(dc) dc.Count)).Max()
        RadChart1.ClientSettings.XScale = DateList.Count / 7
        RadChart1.PlotArea.XAxis.AddRange(1, DateList.Count, 1)
        RadChart1.PlotArea.YAxis.MaxValue = MaxValue + 2
        For i As Integer = 0 To DateList.Count - 1
            RadChart1.PlotArea.XAxis(i).TextBlock.Text = DateList(i)
            RadChart1.PlotArea.XAxis(i).Appearance.Border.Visible = True
 
 
        Next


For some reason the tooltips just aren't showing up.  Is there anything that I'm missing?
Javier
Top achievements
Rank 1
 answered on 20 Mar 2012
1 answer
101 views
Dear All

I would like add a timer control to loop the different user control periodicity. I follow the Telerik Ajax Sample successful do that. In my user control, I have some Jquery/Javascripts would like to run. 

I try to add function pageLoad() in my user control, but still can't run. How can I do that? Thanks

default.aspx.vb
Protected Sub Timer1_Tick(sender As Object, e As System.EventArgs) Handles Timer1.Tick
        If LatestLoadedControlName = "uc1.ascx" Then
            Me.Timer1.Interval = 15000
            LoadUserControl("uc2.ascx")
        Else
            LoadUserControl("uc1.ascx")
        End If
End Sub

uc1.ascx
<script type="text/javascript">
    function pageLoad() {
        alert("test");
    }
</script>

Tsvetina
Telerik team
 answered on 20 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?