Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
89 views
I have RadTimePicker and defined client event for date selection <ClientEvents OnDateSelected="DateChanged" />
Then inside DateChanged function I have the cancel code, which does not work.

 

function DateChanged(sender, args)

 

{

 

 

args.set_cancel(

true);

 

}

My question is how can I make cancel work. Thanks.

Shinu
Top achievements
Rank 2
 answered on 11 Jan 2010
1 answer
112 views
I have a grid which I only 5 columns are shown by default and on insert/edit I show the fields in editformsettings.
I want to use the same editformsettings from a itemcommand for viewing the data but not show the update button.
There is an example of showing the selected row in tooltip but I wanted to use the already existing code for the same having the same look and feel.

Is this possible?

Thanks,
Anil
Princy
Top achievements
Rank 2
 answered on 11 Jan 2010
1 answer
173 views
hi
how to make the last row of the databind into the grid to appear as bold in text style.

please help
Shinu
Top achievements
Rank 2
 answered on 11 Jan 2010
4 answers
99 views
Hi. Is it possible to have inplace editing with a user control form? Or at least hide the row that you are editing when the the user control appears. Thanks.

Daniel
Daniel
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 11 Jan 2010
0 answers
136 views
hi.
i am using hierarchy radgrid.
here i want to know the clicked cell header text in client side.
when i right click on the cell i want to get the clicked cell column name.

can any one help me how to do this task.

using this code i am able to getting the cell index.but i can't able to getting the column header text.

function RowContextMenu(sender, eventArgs)  
{ 
        if (eventArgs.get_tableView().get_name() == "PRRequests")  
                {  
                    if (eventArgs.get_domEvent().target.tagName == "TD") 
                    { 
                    alert(eventArgs.get_domEvent().target.cellIndex);  
                    //alert(eventArgs.get_gridColumn().get_uniqueName()); 
                    } 
                }  
} 
 
"PRReuests" is the Detail Table Name.

Thank You
Suresh K



Suresh K
Top achievements
Rank 1
 asked on 11 Jan 2010
4 answers
369 views
Hi!

Got a page with multiple tabs on it and let's just say the user is on
second tab which is company users where they can go on to create
another user. When the user is created and they return back to the
main page, I'd like to by default select the second tab which is the
one they were on in the first place.

Got this scenario popping up all over and just not sure what is best
way of doing it? Had a look at FindTabByUrl but does not seem to
do it for me...
Joe
Top achievements
Rank 1
 answered on 10 Jan 2010
3 answers
118 views
Am I missing something here? menu is not displaying any data, even though adding a breakpoint on the query and look at the results it is returning 3 records.
adminMenu user control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="adminMenu.ascx.cs" Inherits="Waivenet.adminMenu" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<telerik:RadMenu ID="RadMenu1" runat="server"> 
</telerik:RadMenu> 
 
 

adminMenu code behind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using Waivenet.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
namespace Waivenet 
{ 
    public partial class adminMenu : System.Web.UI.UserControl 
    { 
         
 
        protected void Page_Load(object sender, EventArgs e) 
        { 
DataClassesDataContext dbcontext = new DataClassesDataContext(); 
            RadMenu1.Skin = SessionWrapper.skin;             
            var sdf = from s in dbcontext.siteMaps.ByHierarchy<siteMap>(t => t.sitemapID == SessionWrapper.siteMapIDCurrent, (parent, child) => (parent.sitemapID == child.parentID)) select new { s.Item.parentID, s.Item.sitemapID, s.Item.name, s.Item.pagePath }; 
            RadMenu1.DataFieldID = "sitemapID"; 
            RadMenu1.DataFieldParentID = "parentID"; 
            RadMenu1.DataTextField = "name"; 
            RadMenu1.DataValueField = "sitemapID"; 
            RadMenu1.DataNavigateUrlField = "pagePath"; 
            RadMenu1.DataSource = sdf; 
             
            RadMenu1.DataBind();            
             
        }         
    } 
} 


If I use an <items> tag in the markup the menu displays it no probs. the ByHierarchy extension method is a way to retrieve hierarchal linq data, stolen from here: http://weblogs.asp.net/okloeten/archive/2006/07/09/Hierarchical-Linq-Queries.aspx

Growls
Top achievements
Rank 1
 answered on 10 Jan 2010
3 answers
127 views
Hi
I need to set the image for the panelbar items at runtime .how can i do this ? I tried the code . but it not works to me.Pls review my code and let me know how to resolve this problem.I need to set the imageurl from the sqldatasource imageurl field ( I M USING VB CODE IN CODEBEHIND )

 

<telerik:RadPanelBar ID="RadPanelBar1" runat="server"
DataFieldID="MENUCODE"
DataFieldParentID="PARENTID"
DataSourceID="SqlDataSource1"

 

 

DataTextField="MENUDESCRIPTION"
DataValueField="MENUDESCRIPTION" 
ExpandMode="FullExpandedItem"
DataNavigateUrlField="NAVIGATEURL">

 

 

</telerik:RadPanelBar>

 

asp

 

:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TrackConnectionString %>"

 

 

 

 

 

SelectCommand="SELECT MENUCODE, MENUDESCRIPTION, PARENTID, COMPANYID, NAVIGATEURL FROM MENUTABLE"

 

 

 

 

 

 

</asp:SqlDataSource>

 

Simon
Telerik team
 answered on 10 Jan 2010
4 answers
251 views
I am new to RadPanelBar.  I want to dynamically bind not just menu text / structure but also images. Is there any way to do that?

Here is my test code modified from sample:
    protected void Page_Load(object sender, EventArgs e)  
        {  
            if(!this.IsPostBack)  
            {  
                uxLFMenuBarML.DataTextField = "Text";  
                uxLFMenuBarML.DataFieldID = "ID";  
                uxLFMenuBarML.DataFieldParentID = "ParentID";  
                uxLFMenuBarML.DataSource = GenerateSiteData();  
                uxLFMenuBarML.DataBind();  
 
            }  
 
        }  
 
    private ArrayList GenerateSiteData()  
        {  
            ArrayList siteData = new ArrayList();  
            siteData.Add(new LFMenuBarDataItem(1, null, "All Sites","~/images/1.jpg"));  
            siteData.Add(new LFMenuBarDataItem(2, 1, "Search Engines", "~/images/2.jpg"));  
            siteData.Add(new LFMenuBarDataItem(3, 1, "News Sites", "~/images/3.jpg"));  
            siteData.Add(new LFMenuBarDataItem(4, 2, "Yahoo", "~/images/4.jpg"));  
            siteData.Add(new LFMenuBarDataItem(5, 2, "MSN", "~/images/5.jpg"));  
            siteData.Add(new LFMenuBarDataItem(6, 2, "Google", "~/images/6.jpg"));  
            siteData.Add(new LFMenuBarDataItem(7, 3, "CNN", "~/images/7.jpg"));  
            siteData.Add(new LFMenuBarDataItem(8, 3, "BBC", "~/images/8.jpg"));  
            siteData.Add(new LFMenuBarDataItem(9, 3, "FOX", "~/images/9.jpg"));  
            return siteData;  
        }  
 
 
 
 
    public class LFMenuBarDataItem  
    {  
        private string _text;  
        private int _id;  
        private int? _parentId;  
        private string _imageUrl;  
        public string Text  
        {  
            get { return _text; }  
            set { _text = value; }  
        }  
        public int ID  
        {  
            get { return _id; }  
            set { _id = value; }  
        }  
        public int? ParentID  
        {  
            get { return _parentId; }  
            set { _parentId = value; }  
        }  
        public string ImageUrl  
        {  
            get { return _imageUrl; }  
            set { _imageUrl = value; }  
        }  
        public LFMenuBarDataItem(int id, int? parentId, string text, string imageUrl)  
        {  
            _id = id;  
            _parentId = parentId;  
            _text = text;  
            _imageUrl = imageUrl;  
        }  
    } 

Simon
Telerik team
 answered on 10 Jan 2010
6 answers
224 views
Hi,

I'm trying to build up a portal home page that retrieve a big amount of data. One of the best options i had is to load the homepage (first half) and then fire ajaxRequest calls to retrieve the rest of sections upon the load completion (second lower half).

below are the scenario steps I'm trying to achieve,

  1. user request homepage
  2. homepage loads and a JavaScript fires to call for the first ajaxRequest
  3. first call is made, and once done it fires the next ajaxRequest "since you can't retrieve all sections in parallel"
  4. point number 3 keeps recurring several time until all sections are retrieved

I implemented the above scenario using RadAjaxPanel and it worked so fine, however using RadAjaxManager is much better as per several articles posted on your forum.

I tried hard to implement the above scenario using RadAjaxManager, and almost succeeded however the content is not updated even after a successful ajaxRequest, I traced the whole solution from the point of the first request and every thing works fine however it does not update the DIVs.

below is the XHTML code,

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title></title> 
    <style type="text/css"> 
 
.MyAjaxLoadingPanel 
{ 
    background:#fff url(images/ajax-loader.gif) center center no-repeat; 
} 
 
</style> 
</head> 
<body onload="initTimer();return false;"> 
 
    <form id="form1" runat="server"> 
     
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
    </telerik:RadScriptManager> 
     
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  
        RequestQueueSize="5" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> 
        <ClientEvents OnResponseEnd="reqEnd" /> 
        </telerik:RadAjaxManager> 
     
     
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"  
        BackColor="White" EnableViewState="False" CssClass="MyAjaxLoadingPanel"> 
        <div style="width:100%; padding-top:20px; text-align:center; font-family:Tahoma; font-size:12px;" >Loading...</div> 
    </telerik:RadAjaxLoadingPanel>   
       
    <div style=" background-color:#eeeeee;width:400px; height:200px;" ID="div1" runat="server">         
             <br /> 
        <ul> 
        <asp:Repeater ID="Repeater1" runat="server" EnableViewState="False"> 
        <ItemTemplate> 
        <li>            
            <%#Container.DataItem("column")%> 
        </li>         
        </ItemTemplate> 
        </asp:Repeater> 
        </ul>               
    </div> 
     
    <br /> 
    <div style=" background-color:#eeeeee;width:400px; height:200px;" ID="div2" runat="server">           
              <br /> 
        <ul> 
        <asp:Repeater ID="Repeater2" runat="server" EnableViewState="False"> 
        <ItemTemplate> 
        <li>               
            <%#Container.DataItem("column")%> 
        </li>         
        </ItemTemplate> 
        </asp:Repeater> 
        </ul>         
    </div> 
     
    <br /> 
    <div style=" background-color:#eeeeee;width:400px; height:200px;" ID="div3" runat="server">         
              <br /> 
        <ul> 
        <asp:Repeater ID="Repeater3" runat="server" EnableViewState="False"> 
        <ItemTemplate> 
        <li>             
            <%#Container.DataItem("column")%> 
        </li>         
        </ItemTemplate> 
        </asp:Repeater> 
        </ul>         
    </div> 
     
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> 
    <script language="javascript" type="text/javascript"> 
    var id,id2,id3; 
 
    function initTimer() {       
             id= setTimeout('AJAXReq()', 5000);              
    }          
 
    function AJAXReq(){         
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
            ajaxManager.ajaxRequest("Sport"); 
            clearTimeout(id); 
    } 
     
    function reqEnd(sender, eventArgs){         
        switch (eventArgs.get_eventArgument()) 
            { 
                case "Sport":                     
                    id2 = setTimeout('AJAXReq2()', 200); 
                    break; 
                case "Health": 
                    id3= setTimeout('AJAXReq3()', 200); 
                  break;                 
            } 
        } 
 
        function AJAXReq2() {            
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
            ajaxManager.ajaxRequest("Health"); 
            clearTimeout(id2); 
        } 
 
        function AJAXReq3() {            
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>"); 
            ajaxManager.ajaxRequest("Science"); 
            clearTimeout(id3); 
        } 
         
    </script> 
    </telerik:RadCodeBlock> 
     
    </form> 
</body> 
</html> 

and here is the code behind,

Imports System.Data.SqlClient 
 
Partial Class test 
    Inherits System.Web.UI.Page 
 
 
    Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest 
        Select Case e.Argument 
            Case "Sport" 
 
                Threading.Thread.Sleep(1000) 
 
 
                Dim x As New Database 
                Dim s1 As SqlDataReader = x.ExecuteReader("Select query") 
                Me.Repeater1.DataSource = s1 
                Me.Repeater1.DataBind() 
                s1.Close() 
 
 
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, div2, Me.RadAjaxLoadingPanel1) 
 
 
            Case "Health" 
 
                Threading.Thread.Sleep(1000) 
 
                Dim x As New Database 
                Dim s1 As SqlDataReader = x.ExecuteReader("Select query") 
                Me.Repeater2.DataSource = s1 
                Me.Repeater2.DataBind() 
                s1.Close() 
 
 
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, div3, Me.RadAjaxLoadingPanel1) 
 
            Case "Science" 
 
                Threading.Thread.Sleep(1000) 
 
                Dim x As New Database 
                Dim s1 As SqlDataReader = x.ExecuteReader("Select query") 
                Me.Repeater3.DataSource = s1 
                Me.Repeater3.DataBind() 
                s1.Close() 
 
        End Select 
 
    End Sub 
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
        If Not Page.IsPostBack Then ' tried it without page.IsPostBack, however loading panel shows for all sections once an ajaxRequest is executed 
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadAjaxManager1, div1, Me.RadAjaxLoadingPanel1) 
        End If 
    End Sub 
 
End Class 
 

Note: this scenario is an updated version for the below scenario and issue,
http://www.telerik.com/community/forums/aspnet-ajax/ajax/loading-panel-not-displaying.aspx

Awaiting your reply

Happy new year :-)

loai taha
Top achievements
Rank 1
 answered on 10 Jan 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?