Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
Hi,

I am trying to use the Rad Scheduler for Upcoming Events page. Planning to set each appointment clickable and adding a redirect link when the event 'AppointmentClick' fires however it does not redirect to the new page specified. The redirect is a working link. Please help me on this.

Thanks in advance.
Srilal
Nikolay Tsenkov
Telerik team
 answered on 15 Aug 2011
1 answer
252 views
Hello -

I have a simple RadGrid that returns a number of records with href links.  It also has paging enabled.  I would like to see a LoadingPanel when the user clicks one of the links in the RadGrid, but not when they make a paging request.  From what I have read this would be possible utilizing the EventName when creating the AjaxSetting, like so:

<telerik:AjaxSetting AjaxControlID="MyRadGrid" EventName="SelectedIndexChanged">
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="panelResults" LoadingPanelID="RadAjaxLoadingPanel1" />                                       
    </UpdatedControls>
</telerik:AjaxSetting>

<telerik:RadGrid ID="MyRadGrid" runat="server" GridLines="None" Width="700px" AllowPaging="true" PageSize="10" OnNeedDataSource="MyRadGrid_NeedDataSource" EnableViewState="true" Visible="true">
  <MasterTableView Caption="My Report" CommandItemDisplay="Top" CommandItemSettings-ShowAddNewRecordButton="false" DataKeyNames="ReportInfoID" NoDetailRecordsText="Nothing Found.">
    <PagerStyle Mode="Slider"  />
    <Columns>
    <telerik:GridButtonColumn UniqueName="ReportURL" DataTextField="Name" CommandName="Select"></telerik:GridButtonColumn>
    </Columns>                         
  </MasterTableView>                           
</telerik:RadGrid>

The above markup works great for selecting the links in the RadGrid and showing the LoadingPanel, but it also shows during the paging requests.  Essentially it performs the same regardless of if I specify the EventName or not.  I can change EventName to anything and it still always fires.

Am I missing something here or is this not possible?

Thanks
Maria Ilieva
Telerik team
 answered on 15 Aug 2011
1 answer
49 views
Here is a really simple example and I wish I could show a screenshot. What I'm doing is trying to create a margin. In only IE (using version 8) the margin in the div seems to affect the button. It creates an additional set of padding in front of the button and almost toward the end of the button, a strip of white padding overlays the button. I am not using any additional styling. Actually, when you tab to it, the white space in the front of the button also appears to be part of the button. This is it on the page. I have tried several things from using a css class (not doing that here to keep it as simple as possible) to including an additional div tag. or using span tags

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server" />
    <div style="margin: 20px"
            <p>text that is indented with margin: 20px, however, the button seems to take on strange margins</p>
            <telerik:RadButton runat="server" id="btnContinue" Text="Example" />              
    </div>
    </form>
</body>
</html>
Slav
Telerik team
 answered on 15 Aug 2011
1 answer
128 views
Here is my situation. I have a tree that uses load on demand. The first level is Offices and the second level are Contacts in corresponding offices.
Now, the data source for the offices also returns the number of contacts in the office, which is helpful for this load on demand scenario (the user now knows if the office has nodes in it). However, to display the number in a different color beside the office title, I need to use a template of the Office Nodes. But I want the Contact Nodes below to be regular RadTreeNodes. Now I got it working one way programmatically, but I feel using template on the ASPX side would faster.

Here is my attempt at the ASPX side, which is completely broken and completely wrong, but I'm using it to give you a sense of where I am going.
<telerik:RadTreeView ID="_tvOffice" AutoPostBack="true" Width="100%" Skin="Office2007"
            EnableDragAndDropBetweenNodes="true" EnableDragAndDrop="True"
            runat="server"
            DataFieldID="ID" ContextMenuItemClick="_tvOffice_ContextMenuItemClick" OnNodeExpand="_tvOffice_NodeExpand">
           <NodeTemplate>
                <telerik:RadTreeNode runat="server">
                </telerik:RadTreeNode>
            </NodeTemplate>
            <Nodes>
                <telerik:RadTreeNode EnableContextMenu="false" CssClass="spIcon spFldr_C" AllowDrag="false"
                    AllowDrop="true" ExpandMode="ServerSideCallBack" runat="server">
                    <NodeTemplate>
                        <asp:Label ID="_lblTitle" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.officeTitle")%>'></asp:Label>
                        <asp:Label ID="_lblCount" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.ContactCount", "({0})")%>'
                            CssClass="lblProjectNum"></asp:Label>
                    </NodeTemplate>
                </telerik:RadTreeNode>
            </Nodes>
            <DataBindings>
              <telerik:RadTreeNodeBinding Depth="0" EnableContextMenu="false" CssClass="spIcon spFldr_C" AllowDrag="false"
                    AllowDrop="true" ExpandMode="ServerSideCallBack" TextField="officeTitle" ValueField="ID" CategoryField="Category" />
            </DataBindings>
        </telerik:RadTreeView>

private void RebindOfficeTree(int? companyId)
        {
            if (companyId == null) return;
            
            var db = new DBStoredProc();
            var officeList = db.Offices_OnDemand(companyId);
            _tvOffice.DataSource = officeList;
            _tvOffice.DataBind();
        }
 
private static void PopulateContactsByOffice(RadTreeNodeEventArgs e)
        {
            if (e == null || e.Node.Value == null) return;
 
            var db = new DataContext();
            var officeId = int.Parse(e.Node.Value);
            var contactList = Contacts.LoadByOfficeId(db, officeId);
 
            foreach (var contact in contactList)
            {
                var node = new RadTreeNode
                {
                    Text = contact.FullName,
                    Value = contact.Id.ToString(),
                    CssClass = "spIcon spContact",
                    Category = "Contact",
                    AllowDrag = true,
                    AllowDrop = false
                };
                e.Node.Nodes.Add(node);
            }
            e.Node.Expanded = true;
        }


Also, I am grabbing the offices by clicking on a Company Node on another tree, but using per-node template, a "blank" tree node appears in the Office tree on page load (before selecting any company).

The point here is speed. I want to use the fastest, most optimized method to do this.
Nikolay Tsenkov
Telerik team
 answered on 15 Aug 2011
1 answer
130 views
Dear Telerik team,

As I have to purchase the ASP.NET Ajax Controls of Telerik, i have below clarification.. Pls clarify me.

I will buy the developer license for the ASP.NET Ajax Controls.
Should I purchase the client license for the same while implementing in the client machine?
Is the developer license included the client license also?
Kindly clarify me.. I need to approach the top level management of my concern to purchase the telerik package.
Emilia
Telerik team
 answered on 15 Aug 2011
1 answer
47 views
Greetings,
Please i have the following bug when using the ColorPicker with a right to left page and the ShowIcon property is set to true, the selected color is not appearing on the icon (the color of the icon is always white).
Slav
Telerik team
 answered on 15 Aug 2011
2 answers
75 views
On the server side, I've built a RadTreeView whose nodes have attributes.

RadTreeView tree = new RadTreeview();
tree.ID = "MyRadTree";
tree.WebServiceSettings.Path = "MyServices.svc";
tree.WebServiceSettings.Method = "GetNodes"
...
RadTreeNode nodes = new RadTreeNode();
...
RadTreeNode expandNode1 = new RadTreeNode();
expandNode1.Text = "Apples";
expandNode1.Value = "1";
expandNode1.Attributes.Add("NodeType", "Fruit");
expandNode1.ExpandNode = TreeNodeExpandNode.WebService;
...
tree.Nodes.AddRange(nodes);

My service, GetNodes(), is called, but the node.Attributes count is 0.

[OperationContract]
public RadTreeNodeData[] GetNodes(RadTreeNodeData node, IDictionary<string, object> context)
{
   string value = node.Value; // ok
   string text = node.Text; // ok
   int attributeCount = node.Attributes.Count; // 0
   string attribute = node.Attributes["NodeType"]; // Exception "The given key was not present in the dictionary"
}

Is this supposed to work?  Any ideas what I could be missing?  Might I need to add a [WebInvoke ...] attribute to my web method, perhaps changing the method style?

(Note that the attribute(s) are available from the client side; they just don't seem to make it through to the web service.)

Thanks.
Nikolay Tsenkov
Telerik team
 answered on 15 Aug 2011
7 answers
147 views

Hello,

I use trial version of Web UI Controls & Components for ASP.NET AJAX. I’ve faced a problem with RadRotator animation. I use it in Web User Control. Here is the code for my control FabricItunes.ascx :

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FabricItunes.ascx.cs" Inherits="test.Controls.FabricItunes" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<style type="text/css">
    .rotWrapper
    {
        margin-left: auto;
        margin-right: auto;
        height: 260px;
        font-family: Arial;
        padding: 190px 0 0;
        width: 750px;
        background: #fff url("travel_back.jpg") no-repeat 0 0;
        font: 14px 'Segoe UI' , Arial, Sans-serif;
        color: #000;
    }       
    .RemoveRotatorBorder div.rrClipRegion
    {
        /* The following style removes the border of the rotator that is applied to the items wrapper DIV of the control by default, in case the control renders buttons.
        In case you want to removed this border, you can safely use this CSS selector. */
        border: 0px none;
    }
</style>
 
<telerik:RadRotator ID="RadRotator1"
                    runat="server"
                    Width="575px"
                    ItemWidth="140px"
                    Height="130px"
                    ItemHeight="86px"
                    FrameDuration="100000"
                    PauseOnMouseOver="False"
                    RotatorType="CoverFlow"                    
                    CssClass="RemoveRotatorBorder"
                    Skin="Web20"
                    WrapFrames="False"                    
                    onitemclick="RadRotator1_ItemClick">
    <ItemTemplate>
        <asp:Image ID="Image1" runat="server" ImageUrl='<%# Container.DataItem %>' AlternateText="<%# VirtualPathUtility.GetFileName(Container.DataItem.ToString()) %>" />
        <asp:Label ID="Label1" runat="server" Text="<%# VirtualPathUtility.GetFileName(Container.DataItem.ToString()).Substring(0, 3) %>"></asp:Label>
    </ItemTemplate>
</telerik:RadRotator>
 
<script type="text/javascript">
    //<![CDATA[
    // The set_scrollAnimationOptions method takes two arguments - the first one is the ClientID of the rotator, which we want to configure and the second one is
    // a hash table with the options we want to apply.
    Telerik.Web.UI.RadRotatorAnimation.set_scrollAnimationOptions("<%= RadRotator1.ClientID %>", // The ClientID of the RadRotator
                    {
                    minScale: 0.8, // The size scale [0; 1], applied to the items that are not selected.
                    yO: 60, // The offset in pixels of the center of the selected item from the top edge of the rotator.
                    xR: -30, // The offset in pixels between the selected items and the first item on the left and on the right of the selected item.
                    xItemSpacing: 50, // The offset in pixels between the items in the rotator.
                    matrix: { m11: 1, m12: 0, m21: -0.1, m22: 1 }, // The 2d transformation matrix, applied to the items that appear on the right of the selected item.
                    reflectionHeight: 0.5, // The height of the reflection
                    reflectionOpacity: 1 // The opacity, applied to the reflection
                }
                );  // end of animationOptions
     //]]>
</script>

The code behid is:

namespace test.Controls
{
  
    public class FabricChoosedEventArgs : EventArgs
    {
        private string _FabricCode;
        public string FabricCode
        {
            get { return _FabricCode; }
            set { _FabricCode = value; }
        }
    }
     
    public partial class FabricItunes : System.Web.UI.UserControl
    {
        public delegate void FabricChoosedEventHandler(object sender, FabricChoosedEventArgs e);
 
        public event FabricChoosedEventHandler OnFabricChoosed;
 
        string virtualPath = "~/Images/Fabrics/";
 
         
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                FabricColorID = 0;
                ConfigureRadRotator(FabricColorID);            }
        }
 
        public void ConfigureRadRotator(int FabricColorID)
        {
            RadRotator1.RotatorType = RotatorType.CoverFlow;
            RadRotator1.DataSource = GetFilesInFolder(virtualPath, FabricColorID);
            RadRotator1.InitialItemIndex = 0;
            RadRotator1.DataBind();
        }
 
        protected List<string> GetFilesInFolder(string folderVirtualPath, int FabricColorID)
        {
            testws ws = new testws();
            List<string> FL = new List<string>();
            FL = ws.FabricsByColor(FabricColorID).ToList();
            List<string> virtualPathsCollection = new List<string>();
            foreach (String path in FL)
            {
                string virtualPath = VirtualPathUtility.AppendTrailingSlash(folderVirtualPath) + System.IO.Path.GetFileName(path) + "_th.jpg";
                virtualPathsCollection.Add(virtualPath);
            }
            return virtualPathsCollection;
        }
 
        protected void RadRotator1_ItemClick(object sender, RadRotatorEventArgs e)
        {
            Label lbl = e.Item.FindControl("Label1") as Label;
                if (this.OnFabricChoosed != null)
                {
                    FabricChoosedEventArgs r = new FabricChoosedEventArgs();
                    r.FabricCode = lbl.Text;
                    this.OnFabricChoosed(this, r);
                }
        }
    }
}

Now when I place this web user control on Web Form Using Master Page it loads perfectly with needed animation effects firs time. But when I click a rotator item it causes page post back and rotator loses all its animation effects.

Here is the code for Web Form:

<%@ Page Title="" Language="C#" MasterPageFile="~/Shop.Master" AutoEventWireup="true" CodeBehind="Shop.aspx.cs" Inherits="test.Shop" %>
<%@ Register src="Controls/BuyItem.ascx" tagname="BuyItem" tagprefix="uc1" %>
<%@ Register src="Controls/FabricItunes.ascx" tagname="FabricItunes" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder_MainArea" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
    <ContentTemplate>
        <uc3:BuyItem ID="BuyItem1" runat="server" />
    </ContentTemplate>
</asp:UpdatePanel>
<div id="pnlProductItunes">
    <asp:UpdatePanel runat="server" UpdateMode="Always">
    <ContentTemplate>
        <div style="height: 155px; margin-top: 35px;">
            <uc2:FabricItunes ID="FabricItunes" runat="server" />
        </div>
    </ContentTemplate>
    </asp:UpdatePanel>
</div>
</asp:Content>

The code behid is:

namespace test
{
    public partial class Shop : System.Web.UI.Page
    {
         
        protected void Page_Load(object sender, EventArgs e)
        {
            this.FabricColors.OnFabricColorChoosed += new test.Controls.FabricColors.FabricColorChoosedEventHandler(FabricColors_OnFabricColorChoosed);
            this.FabricItunes.OnFabricChoosed += new test.Controls.FabricItunes.FabricChoosedEventHandler(FabricItunes_OnFabricChoosed);
        }
 
        void FabricItunes_OnFabricChoosed(object sender, Controls.FabricChoosedEventArgs e)
        {
            this.BuyItem1.showFabricImage(e.FabricCode);
        }
   }
}

Please advise how to avoid this animation loosing.
Thanks in advance for any suggestion.

Niko
Telerik team
 answered on 15 Aug 2011
1 answer
165 views
i have a radmenu (skin/black) with a specific width (200px), problem is when a menu item is long and it wraps, the CSS sprite image - since its intended for single line menuItem i think, shows other image included in the sprite image  (please see attachment)

now, what i want to happen in when a menuItem wraps and more than one line, the arrow and the background fits perfectly or in the center.

 thanks in advance.

Edit: i'm just looking for a quick fix if there's any (i mean not changing the rmSprite entirely) Or back to square one and just custom the whole thing? hehe
Kate
Telerik team
 answered on 15 Aug 2011
2 answers
73 views
Hello,

I would like to reverse the sliding pane/spillters action.....well part of it. For example I would have a splitter, then a pane then a splitbar then a pane and done.
All this works fine with the split bar between the two panes with both panes visable. The split bar is set to collapse backward. So both panes are visable and when you click on the splitter the splitter moves to the bottom and the bottom pane is hidden.

This is exactly the opposite of what I want. What I would like is when the splitter is (not collapsed) ie between the two panes that the bottom pane be hidden and when the splitter is clicked the splitter draws down revealing the pane contents.

Also the PM would like me to override the default arrow image in the center of the splitter with text "More" and "Less" for the users. So for example when the splitter is at the bottom of the top pane (the top of the bottom pane) it would say More indicating there is more choices if you click. Then when the splitter is at the bottom switch it to say "Less" telling the user they can close up and hide some options.

TIA
JB
Ramjet
Top achievements
Rank 1
 answered on 15 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?