Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
213 views
I have copy the exact blockConfirm script in the demo, and try to use it in my custom dialog. it works fine if I put it in the button "OnClientClick" event directly.

here is my working code snippet

OnClientClick="return blockConfirm('The selected Dynamic Content will be deleted. Are you sure you would like to continue?', event, 450, 100,'','DELETE DYNAMIC CONTENT');" 



However, now I need to do ajax postback to do another check and alert before I show the confirm, I changed OnClientClick to call "DeleteDynamicContent" function, and I received 'event' is not defined error.

here is my new js

function DeleteDynamicContent(dynamicContentID) { 
 
        PageMethods.GetTotNoOfRules( 
            dynamicContentID, 
            Validate_OnSucceeded, Validate_OnFailed); 
        return false; 
    } 
 
    function Validate_OnSucceeded(result) { 
        if (result == true) { 
            radalert('<%= getHelpText("Delete Dynamic Content Alert", "1a") %>', 450, 100, "DELETE DYNAMIC CONTENT"); 
            return; 
        } 
        else { 
            return blockConfirm('The selected Dynamic Content will be deleted. Are you sure you would like to continue?', event, 450, 100, '', 'DELETE DYNAMIC CONTENT'); 
        } 
 
    } 
 
    function Validate_OnFailed(error) { 
        alert(error);         
    } 



Please help!

Thanks

Georgi Tunev
Telerik team
 answered on 01 Jul 2010
1 answer
109 views
After trying for hours to accomplish something that in theory should be a simple task, i've decided to turn to the forums for help!

I have a tree view (with checkboxes) with ONE parent node, and multiple child nodes.

I also have an asp:OptionButtonList, with three options: Full, Partial, and None.

If a user clicks "Full", the Parent node and child nodes should be checked.

If a user clicks "Partial", only the Parent node should be checked...no child nodes.

And, obviously, if a user clicks "None", no nodes should be checked.

I can get the Full and None options to work...but not the partial.

Can anyone help?

So far i'm doing this:

switch (rbl.SelectedValue)  
            {  
                case "FullToHMHS":  
                    radTreeView.CheckAllNodes();  
                    return;  
                case "FullToOther":  
                    isChecked = false;  
                    break;  
                case "Partial":  
                    isChecked = false;  
                    break;  
                default:  
                    break;  
            }  
 
            foreach (RadTreeNode node in radTreeView.Nodes)  
            {           
                node.Checked = isChecked;                  
            } 

obviously this isn't going to accomplish what I want for the "Partial" option, but i've tried what seems like a billion different things, and I can't seem to just check the Parent Node...

Thanks in advance!
V
Nikolay Tsenkov
Telerik team
 answered on 01 Jul 2010
1 answer
47 views
Hi,

I have an ASPX page, which I want to display in a RadWindow.
Is this possible?

Please suggest.

Thanks.
Debashis
Georgi Tunev
Telerik team
 answered on 01 Jul 2010
1 answer
53 views
Hi Telerik,
I was just trying to get into the subject mentioned above and when I used your sample from the documentation I realised that it wouldn't work. It took me a while to figure out why: one needs to add something like "<input type="text" id="txtUserInput" />" to the Dialog page. Otherwise it just shows a blank RadWindow which is not quite whar the example intends to demonstrate. As a newbie to the Telerik controls I find it irritating if the demos don't work as such.

Thanks, Wolfgang

Georgi Tunev
Telerik team
 answered on 01 Jul 2010
1 answer
133 views
Hi all,

I'm trying to use rotator in my application, but I noticed that it doesn't keep a constant size for its items, at start everything sits on its place, but while rotating the items tend to shift aside, is it a bug? I'll attach two screenshots, please take a look at them.

Many thanks

Giorgi
Fiko
Telerik team
 answered on 01 Jul 2010
1 answer
143 views
hello,
 trying to get you tooltip + calendar demo to work. i have everything working correctly aside from the toolTip display. It goes through its brief loading screen and then disappears without ever showing any of its content.

*page is referencing a nested master page that contains a ajaxscript manager not a radscript manager

page hosting calendar
<%@ Page Language="C#" AutoEventWireup="true"  MasterPageFile="~/Default.Master" CodeBehind="Events.aspx.cs" Inherits="MemberPortal.UI.Web.Site.Events" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Content ContentPlaceHolderID="ContentPlaceHolder1" ID="ContentPlaceHolder1" runat="server">  
 
            <style type="text/css">  
                .style1  
                {  
                    width: 80%;  
                }  
                .style2  
                {  
                    width: 128px;  
                    height: 128px;  
                }  
                .style3  
                {  
                    width: 146px;  
                }  
                .style4  
                {  
                    font-family: Calibri;  
                    font-size: medium;  
                    color: #C0C0C0;  
                    border-left-color: #A0A0A0;  
                    border-right-color: #C0C0C0;  
                    border-top-color: #A0A0A0;  
                    border-bottom-color: #C0C0C0;  
                }  
                .Event  
        {  
            _ackground: #DFEEFF none repeat scroll 0 0;  
            background: #DFEEFF url(./Images/Appointment.png) center no-repeat;  
            border-color: #F6FAFF -moz-use-text-color #A7C0DF;  
            border-style: solid none;  
            border-width: 1px 0;  
        }  
            </style> 
            <table align="center" width="100%">  
                <tr> 
                    <td> 
                        &nbsp;  
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                       <telerik:RadCalendar Skin="Hay" ID="RadCalendar1" Width="400" Height="300"    
                    runat="server" OnDayRender="RadCalendar1_DayRender" > 
                </telerik:RadCalendar> 
                <telerik:RadToolTipManager Width="220px" Height="300px" RelativeTo="Element" ID="RadToolTipManager1" 
                    runat="server" OffsetX="15" Position="MiddleRight" ShowDelay="0" OnAjaxUpdate="RadToolTipmanager1_AjaxUpdate" 
                    Skin="Hay">  
                </telerik:RadToolTipManager> 
                    </td> 
                </tr> 
                <tr> 
                    <td> 
                         
                    </td> 
                </tr> 
            </table> 
 
     
</asp:Content> 
 

page host calendar code behind
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using Telerik.Web.UI;  
 
using System.IO;  
using System.Data.SqlClient;  
using System.Configuration;  
using Tegrit.MemberPortal.UI.Web.Site.Views;  
 
namespace MemberPortal.UI.Web.Site  
{  
    public partial class Events : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            if (!Page.IsPostBack)  
            {  
                List<EventInformationModel> events = new List<EventInformationModel>();  
                MockService service = new MockService();  
                events = service.GetEvents();  
                Session["Events"] = events;  
            }  
        }  
 
        protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)  
        {  
            int ID = IsDayRegisteredForTooltip(e.Day.Date);  
            if (ID != -1)  
            {  
                TableCell cell = e.Cell;  
                cell.CssClass = "Event";  
                cell.Attributes.Add("id", "Calendar1_" + ID.ToString());  
                RadToolTipManager1.TargetControls.Add(e.Cell.Attributes["id"], ID.ToString().Substring(ID.ToString().IndexOf('_') + 1), true);  
            }  
        }  
 
        private int IsDayRegisteredForTooltip(DateTime date)  
        {  
            List<EventInformationModel> events = (List<EventInformationModel>)Session["Events"];  
            List<EventInformationModel> m = (from e in events  
                                             where e.Date == date  
                                             select e).ToList<EventInformationModel>();  
                if (m.Count > 0)  
                {  
                    return int.Parse(m[0].eventID.ToString());  
                }  
 
            return -1;  
 
            }  
 
        private EventInformationModel GetEventByID(int id)  
        {  
           List<EventInformationModel> events = (List<EventInformationModel>)Session["Events"];  
 
           EventInformationModel m = (from e in events  
                                            where e.eventID == id  
                                            select e).Single<EventInformationModel>();  
           return m;  
        }  
 
        protected void RadToolTipmanager1_AjaxUpdate(object sender, ToolTipUpdateEventArgs e)  
        {  
            EventDetailsView details = (EventDetailsView)this.LoadControl("views/EventDetailsView.ascx");  
            int eventID = int.Parse(e.Value);  
            details.EventDetail = GetEventByID(eventID);  
            e.UpdatePanel.ContentTemplateContainer.Controls.Add(details);  
        }  
    }  
} 

user control for tooltip display
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EventDetailsView.ascx.cs" Inherits="MemberPortal.UI.Web.Site.Views.EventDetailsView" %> 
<style type="text/css">  
    .style1  
    {  
        width: 200px;  
        height: 118px;  
    }  
</style> 
<table id="Table1"  border="0" cellpadding="2" 
    cellspacing="0">  
    <tr> 
        <td style="text-align: center;" class="style1">  
 
              
                    Name:  
                    <asp:Label ID="lblName"  runat="server" Text='<%# Bind("Name") %>'></asp:Label><br /> 
                    Start:  
                    <asp:Label ID="lblStartTime"  runat="server" Text='<%# Bind("StartTime") %>'></asp:Label><br /> 
                    End:  
                    <asp:Label ID="lblStartTime2" runat="server" Text='<%# Bind("StartTime") %>'></asp:Label><br /> 
                    Person to meet with:  
                    <asp:Label ID="lblEndTime"  runat="server" Text='<%# Bind("EndTime") %>'></asp:Label><br /> 
                    <br /> 
 
        </td> 
    </tr> 
</table> 

page hosting tooltip dispaly code behind
using System;  
using System.Collections.Generic;  
using System.Linq;  
using System.Web;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using MemberPortal.UI.DataTransferObjects.ContentManagement;  
 
namespace MemberPortal.UI.Web.Site.Views  
{  
    public partial class EventDetailsView : System.Web.UI.UserControl  
    {  
        private EventInformationModel eventDetail;  
 
        public EventInformationModel EventDetail  
        {  
            get { return eventDetail; }  
            set { eventDetail = value; }  
        }  
 
 
        protected void Page_Load(object sender, EventArgs e)  
        {  
            lblEndTime.Text = eventDetail.EndTime;  
            lblName.Text = eventDetail.Name;  
            lblStartTime.Text = eventDetail.StartTime;  
              
        }  
    }  
} 
Svetlina Anati
Telerik team
 answered on 01 Jul 2010
1 answer
161 views
Hello!

I have a problem with a listview.

Let me detail a little more:

I have 1 listview, 1 objectdatasource and 2 SQLDatasources..

First the listeview is binded with objectdatasource.
What i want to do after and really don't know how is:

At OnItemDataBound Event, i want to Add, fields( to fill fields actually) from the 2 SQLDatasources.

The 2 SQLDataSources should use as a parameter(ID for the sql query) an item from the listview.

So at OnItemDataBound, i should take the ObjectID pass it to the SQLDataSources, and complete the fields in the listview


<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="ObjectDataSource1" 
            ItemPlaceholderID="ListViewContainer" DataKeyNames="ObjectID" AllowPaging="True" OnItemDataBound="Get_rest" > 
            <LayoutTemplate> 
                <asp:PlaceHolder runat="server" id="ListViewContainer" /> 
            </LayoutTemplate> 
            <ItemTemplate> 
                <fieldset style="float: left; width: 350px; height: 250px;"> 
                    <legend style="font-weight: normal"><b>Company Name</b>: 
                        <%# Eval("ShortName")%></legend> 
                    <div class="details"> 
                        <div class="photo-container"> 
                            <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("WebImage") %>' 
                                AutoAdjustImageControlSize="false" Width="120px" ToolTip='<%#Eval("Description", "Photo of {0}") %>' 
                                AlternateText='<%#Eval("Description", "Photo of {0}") %>' /> 
                        </div> 
                        <div class="data-container"> 
 
                            <ul> 
                                
                                <li> 
                                    <label> 
                                        Short name</label> 
                                    <%# Eval("Name")%> 
                                     
                                </li> 
                                <li> 
                                    <label> 
                                        City:</label> 
                                    <%#Eval("City")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        ZIP:</label> 
                                    <%# Eval("ZIP")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        SPR:</label> 
                                    <%#Eval("SPR")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        Country:</label> 
                                    <%#Eval("NationID")%> 
                                </li> 
                                
                                <li> 
                                    <label> 
                                        Telephone:</label> 
                                    <%# Eval("Telephone")%> 
                                </li> 
                                  <li> 
                                    <label> 
                                        Mobile:</label> 
                                    <%# Eval("Mobile")%> 
                                </li> 
                                  <li> 
                                    <label> 
                                        Fax:</label> 
                                    <%# Eval("Fax")%> 
                                </li> 
                                  <li> 
                                    <label> 
                                        E-mail:</label> 
                                    <%# Eval("Email")%> 
                                </li> 
                                  <li style="display:none;"> 
                                     <label id="ObjID_test" runat="server" style="display:none;"> 
                                       <%# Eval("ObjectID")%> </label> 
                                </li> 
                                 
                                 
                            </ul> 
                        </div> 
                    </div> 
                </fieldset> 
            </ItemTemplate> 
        </telerik:RadListView> 
This is how the Listview looks like. the Objects datasource brings back: Image/Shortname/Name, one sql datasource brings back addresses and the other brings back contact types.
What i managed to do so far is to get the ID at the OnItemDatabound event. After this i am a little stuck, as i don't know what to do next.

Having to use 1 objectdatasource and 2 sqlDatasources is mandatory.



I have a little update on my solution, but it's still not working, and i don't know how ti fix it.

the aspx code looks like this now:

<telerik:RadListView ID="RadListView1" runat="server" DataSourceID="ObjectDataSource1" 
            ItemPlaceholderID="ListViewContainer" DataKeyNames="ObjectID" AllowPaging="True" OnItemDataBound="Get_rest" > 
            <LayoutTemplate> 
                <asp:PlaceHolder runat="server" id="ListViewContainer" /> 
            </LayoutTemplate> 
            <ItemTemplate> 
                <fieldset style="float: left; width: 350px; height: 250px;"> 
                    <legend style="font-weight: normal"><b>Company Name</b>: 
                        <%# Eval("ShortName")%></legend> 
                    <div class="details"> 
                        <div class="photo-container"> 
                            <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("WebImage") %>' 
                                AutoAdjustImageControlSize="false" Width="120px" ToolTip='<%#Eval("Description", "Photo of {0}") %>' 
                                AlternateText='<%#Eval("Description", "Photo of {0}") %>' /> 
                        </div> 
                        <div class="data-container"> 
                                                  <ul> 
                                
                                <li> 
                                    <label> 
                                        Short name:</label> 
                                    <%# Eval("Name")%> 
                                     
                                </li> 
                                 
                               <telerik:RadListView ID="RadListView2" runat="server" DataSourceID="SqlDataSource1" 
            ItemPlaceholderID="ListViewContainer" AllowPaging="True" > 
            <LayoutTemplate> 
                <asp:PlaceHolder runat="server" id="ListViewContainer" /> 
            </LayoutTemplate> 
            <ItemTemplate> 
               <%-- <fieldset>--%> 
                    
                         <li> 
                                    <label> 
                                        City:</label> 
                                    <%#Eval("City")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        ZIP:</label> 
                                    <%# Eval("ZIP")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        SPR:</label> 
                                         
                                    <%#Eval("SPR")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        Country:</label> 
                                    <%#Eval("NationID")%> 
                                </li> 
                             
                             
                                 
                           
                         
              <%--  </fieldset>--%> 
            </ItemTemplate> 
        </telerik:RadListView> 
                                
                                <telerik:RadListView ID="RadListView3" runat="server" DataSourceID="SqlDataSource2" 
            ItemPlaceholderID="ListViewContainer" AllowPaging="True" > 
            <LayoutTemplate> 
                <asp:PlaceHolder runat="server" id="ListViewContainer" /> 
            </LayoutTemplate> 
            <ItemTemplate> 
             
               <%-- <fieldset>--%> 
                    
                           <li> 
                                    <label> 
                                        Phone:</label> 
                                    <%# Eval("Telephone")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        Mobile:</label> 
                                    <%# Eval("Mobile")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        FAX:</label> 
                                    <%# Eval("FAX")%> 
                                </li> 
                                <li> 
                                    <label> 
                                        E-mail:</label> 
                                    <%# Eval("Email")%> 
                                </li> 
              <%--  </fieldset>--%> 
            </ItemTemplate> 
        </telerik:RadListView> 
                                                                 
                            </ul> 
                        </div> 
                    </div> 
                </fieldset> 
            </ItemTemplate> 
        </telerik:RadListView> 

and in code behind i have the onitemdatabound function:

Protected Sub Get_rest(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadListViewItemEventArgs) Handles RadListView1.ItemDataBound 
        Dim ObjID As New Integer 
        'Dim RadListColumn As New Telerik.Web.UI.RadListViewDataItemCollection 
 
 
        Dim item = TryCast(e.Item, RadListViewDataItem) 
        If item IsNot Nothing Then 
            Dim value = CInt(DataBinder.Eval(item.DataItem, "ObjectID")) 
            ObjID = value 
        End If 
        SqlDataSource1.SelectParameters("ObjectID").DefaultValue = ObjID 
        SqlDataSource2.SelectParameters("ObjectID").DefaultValue = ObjID 
 
 
 
    End Sub 

Now the problem is that all the items in the listview, have the address and the contacts of the last  ObjectID.

Ideea anyone?




Rosen
Telerik team
 answered on 01 Jul 2010
1 answer
303 views
There is really no documentation to speak of on the Radgrid OnGroupExanded and OnGroupCollapsed client events so I'm hoping I can get some help from the community.

Scenario: I have Client Side Grouping set on a grid and I need to be able to persist what groups were expanded/collapsed between rebinds so I can't use server side itemcommand event because nothing fires sever side when you use client side grouping.

Approach: I am attaching two javascript functions to handle the two different events and fire a ajaxRequest to the server side with the index of the row expanded/collapsed. I have all the server side hash tables set up based on a forum example and will use the grid.item[itemIndex].expanded = true or false to rehydrate on page load.

Problem: I don't know how to get anything from the two client events to determine what item index was expanded/collapsed. The eventArgs are supposed to be a gridDataItem object but I've had no success accessing properties.

Question: How do I get the index of the expanded/collapsed row client side? See below javascript function.

function

 

CollapseGroup(sender, eventArgs) {

 

var itemIndex = eventArgs (what to do here?)

 

 

$find(

 

"ctl00_RadAjaxManager1").ajaxRequest("Collapsed~" + itemIndex);

 

}

 

Rosen
Telerik team
 answered on 01 Jul 2010
3 answers
109 views
Hi,

I'm initializing the editor via:
    <telerik:RadEditor ID="Editor" runat="server" StripFormattingOptions="Font, Span, Css, MSWordRemoveAll" OnClientPasteHtml="OnClientPasteHtml" Width="100%" OnClientModeChange="OnClientModeChange" OnClientCommandExecuting="OnClientCommandExecuting"/>

In source code view I see:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title></title>
    </head>
    <body>


<!-- content -->
    </body>
</html>

I would only like to see <!-- content --> in source code view.
I am not using templatemanager - mentioning that because I saw some discussion about this similar topic and it seemed to be related to templatemanager.

Thanks.







Rumen
Telerik team
 answered on 01 Jul 2010
1 answer
125 views
Hello,

Is there any trick to make rad window support multiple monitors. I know that it interally uses iframe but it opens up new page from the container page. Any tip is apprecited.

Regards
Mac
Georgi Tunev
Telerik team
 answered on 01 Jul 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?