Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
250 views
Hi there,

I have a page with 2 pop-ups. Lets call them window1 and window2. window1 is non-modal and window2 is modal. If window1 is already displayed and I invoke window2 via server side code window2 displays behind window1 even though window2 is modal and window1 is non-modal.

If I click on window2  then window1 and main page now become disabled till I close window2. This is expected behavior since window2 is modal however this behavior does not work till window2 manually receives focus via a mouse click.

1) How to get window2 as top-most window (window2,window1,page)?
2) Is there a way to control the display order of pop-up windows?

I have read the I cannot set hte z-index of the actual windows but only the window manager. I did try adding another window manager to the page. And then setting z-index of the 2 window managers. Window Mgr 1 for Window 1 and Window Mgr 2 for Window 2. Set z-index of Window Mgr 2 to higher value than Window Mgr 1. This did not solve the problem.

Let me know if you need more information.

Thanks for the help.
Mark.
MarkInTexas
Top achievements
Rank 1
 answered on 18 Jun 2008
2 answers
300 views
Hi,

I have the scheduler largely working as it should - inserting and updating are working fine as is deleting stand-alone appointments and recurring series. The problem is when I try to delete an Exception - I get the error: "Cannot locate the parent of appointment with ID = 'x'. Ensure that the parent appointment with ID = 'x' exists and is loaded." I've performed a watch on the Scheduler control at the moment this error is being caught and can see the parent appointment with the right ID exists (It's a string datatype though - could this be the problem?).

So far as I can tell I'm doing everything by the book - saving on AppointmentInsert and AppointmentUpdate, deleting on AppointmentDelete. The error is being thrown after Page_Load (where I bind the scheduler control if it's not postback) but before it reaches the AppointmentDelete event handler. The code is attached.

    <asp:ScriptManager ID="scmEvents" runat="server" OnAsyncPostBackError="scmEvents_AsyncPostBackError" /> 
    <telerik:RadAjaxManager ID="ramEvents" runat="server"> 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="rscEvents"> 
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="rscEvents" LoadingPanelID="ralEvents" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="ralEvents" runat="server" Transparency="10" BackColor="#E0E0E0" InitialDelayTime="500"> 
        <asp:Image ID="imgLoading" runat="server" style="margin-top: 200px;" ImageUrl="" BorderWidth="0px" AlternateText="Loading..." /> 
    </telerik:RadAjaxLoadingPanel> 
    <telerik:RadScheduler ID="rscEvents" runat="server" Width="750px" Height="561px" style="margin: 0 auto;" Skin="Office2007" SelectedView="MonthView" ShowViewTabs="False" 
        OnAppointmentInsert="rscEvents_AppointmentInsert" OnAppointmentUpdate="rscEvents_AppointmentUpdate" OnAppointmentDelete="rscEvents_AppointmentDelete" OnAppointmentDataBound="rscEvents_AppointmentDataBound" 
        DataKeyField="EventId" DataSubjectField="EventName" DataStartField="StartDate" DataEndField="EndDate" DataRecurrenceField="RecurrenceRule"  
        DataRecurrenceParentKeyField="RecurrenceParentId" StartInsertingInAdvancedForm="True" StartEditingInAdvancedForm="True" DisplayRecurrenceActionDialogOnMove="True" EnableResourceEditing="False"> 
        <TimelineView UserSelectable="False" /> 
    </telerik:RadScheduler> 
     
    /// <summary> 
    /// I'm using a form of the MVP pattern which is why all of the event handlers look the way they do.  
    /// </summary> 
    public partial class Events : BasePage, IEventsView 
    { 
        #region Fields 
 
        private EventsPresenter presenter; 
 
        private int eventId = -1; 
        private string eventName = String.Empty; 
        private string eventDescription = String.Empty; 
        private DateTime startDate = DateTime.MinValue; 
        private DateTime endDate = DateTime.MinValue; 
        private string recurrenceRule = String.Empty; 
        private string recurrenceParentId = String.Empty; 
        #endregion 
        #region Constructor 
 
        /// <summary> 
        /// Initializes a new instance of the <see cref="Events"/> class. 
        /// </summary> 
        public Events() 
        { 
            presenter = new EventsPresenter( this, new EventsDataService(), DefaultInjection.GetDefault() ); 
            presenter.Init(); 
        } 
        #endregion 
        #region Events 
 
        /// <summary> 
        /// Occurs when the form is loaded 
        /// </summary> 
        public event EventHandler FormLoad; 
 
        /// <summary> 
        /// Occurs when an appointment is inserted. 
        /// </summary> 
        public event EventHandler AppointmentInsert; 
 
        /// <summary> 
        /// Occurs when an appointment is updated. 
        /// </summary> 
        public event EventHandler AppointmentUpdate; 
 
        /// <summary> 
        /// Occurs when an appointment is deleted. 
        /// </summary> 
        public event EventHandler AppointmentDelete; 
        #endregion 
        #region Event Handlers 
         
        protected void Page_Load( object sender, EventArgs e ) 
        { 
            if ( !IsPostBack ) 
            { 
                if ( FormLoad != null ) 
                { 
                    FormLoad( sender, e ); 
                } 
            } 
        } 
 
        protected void rscEvents_AppointmentInsert( object sender, SchedulerCancelEventArgs e ) 
        { 
            SetAppointmentDetails( e.Appointment ); 
 
            if ( AppointmentInsert != null ) 
            { 
                AppointmentInsert( sender, e ); 
            } 
        } 
 
        protected void rscEvents_AppointmentUpdate( object sender, AppointmentUpdateEventArgs e ) 
        { 
            SetAppointmentDetails( e.ModifiedAppointment ); 
 
            if ( AppointmentUpdate != null ) 
            { 
                AppointmentUpdate( sender, e ); 
            } 
        } 
 
        /// <summary> 
        /// The startDate is used to calculate the beginning date of the schedule 
        /// </summary> 
        protected void rscEvents_AppointmentDelete( object sender, SchedulerCancelEventArgs e ) 
        { 
            eventId = Int32.Parse( e.Appointment.ID.ToString() ); 
            startDate = e.Appointment.Start; 
 
            if ( AppointmentDelete != null ) 
            { 
                AppointmentDelete( sender, e ); 
            } 
        } 
 
        protected void rscEvents_AppointmentDataBound( object sender, SchedulerEventArgs e ) 
        { 
            e.Appointment.ToolTip = e.Appointment.Subject; 
        } 
 
        /// <summary> 
        /// Captures assynchronous exceptions and handles them in the same way as normal exceptions. 
        /// </summary> 
        protected void scmEvents_AsyncPostBackError( object sender, AsyncPostBackErrorEventArgs e ) 
        { 
            throw e.Exception; 
        } 
        
        #endregion 
        
        #region Properties 
         
        /// <summary> 
        /// This property is set by the Presenter when binding the scheduler control. 
        /// </summary> 
        public List<EventDTO> CurrentEvents 
        { 
            set 
            { 
                List<AppointmentDTO> appointments = new List<AppointmentDTO>(); 
 
                foreach ( EventDTO evnt in value ) 
                { 
                    appointments.Add( new AppointmentDTO( evnt ) ); 
                } 
 
                rscEvents.DataSource = appointments; 
                rscEvents.DataBind(); 
            } 
        } 
 
        public int EventId 
        { 
            get { return eventId; } 
        } 
 
        public string EventName 
        { 
            get { return eventName; } 
        } 
 
        public string EventDescription 
        { 
            get { return eventDescription; } 
        } 
 
        public DateTime StartDate 
        { 
            get { return startDate; } 
        } 
 
        public DateTime EndDate 
        { 
            get { return endDate; } 
        } 
 
        public string RecurrenceRule 
        { 
            get { return recurrenceRule; } 
        } 
 
        public string ReccurenceParentId 
        { 
            get { return recurrenceParentId; } 
        } 
        #endregion 
 
        /// <summary> 
        /// The fields being set in this method are used by the Presenter when saving appointments to the database. 
        /// </summary> 
        private void SetAppointmentDetails( Appointment appointment ) 
        { 
            eventId = appointment.ID != null ? Int32.Parse( appointment.ID.ToString() ) : -1; 
 
            eventName = appointment.Subject; 
            startDate = appointment.Start; 
            endDate = appointment.End; 
            recurrenceRule = appointment.RecurrenceRule; 
 
            if ( appointment.RecurrenceParentID != null && !String.IsNullOrEmpty( appointment.RecurrenceParentID.ToString() ) ) 
            { 
                recurrenceParentId = appointment.RecurrenceParentID.ToString(); 
            } 
        } 
        #region Classes 
 
        /// <summary> 
        /// Extends the base EventDTO to accomodate functionality in the Telerik Scheduler control by incorporating the RecurrenceState property and  
        /// making RecurrenceRule and RecurrenceParentId nullable. 
        /// </summary> 
        private class AppointmentDTO : EventDTO 
        { 
            #region Fields 
 
            private RecurrenceState recurrenceState; 
            #endregion 
            #region Constructors 
 
            private AppointmentDTO() 
            { 
                eventId = -1; 
            } 
 
            public AppointmentDTO( int eventId, string eventName, string eventDescription, DateTime startDate, DateTime endDate, string recurrenceRule, string recurrenceParentId ) : this() 
            { 
                this.eventId = eventId; 
                this.eventName = eventName; 
                this.eventDescription = eventDescription; 
                this.startDate = startDate; 
                this.endDate = endDate; 
                this.recurrenceRule = String.IsNullOrEmpty( recurrenceRule ) ? null : recurrenceRule; 
                this.recurrenceParentId = String.IsNullOrEmpty( recurrenceParentId ) ? null : recurrenceParentId; 
 
                if ( recurrenceParentId != null ) 
                { 
                    recurrenceState = RecurrenceState.Exception; 
                } 
                else if ( !String.IsNullOrEmpty( recurrenceRule ) ) 
                { 
                    recurrenceState = RecurrenceState.Occurence; 
                } 
            } 
 
            public AppointmentDTO( EventDTO evnt ) : this( evnt.EventId, evnt.EventName, evnt.EventDescription, evnt.StartDate, evnt.EndDate, evnt.RecurrenceRule, evnt.RecurrenceParentId ) { } 
            #endregion 
            #region Properties 
 
            /// <summary> 
            /// This is being setup as per the Binding Generic List demo but it never gets consumed - something I'm missing here??? 
            /// </summary> 
            public RecurrenceState RecurrenceState 
            { 
                get { return recurrenceState; } 
                set { recurrenceState = value; } 
            } 
            #endregion 
        } 
        #endregion 
    } 

I know that you can't see how the deletes, updates and inserts are actually being implemented because I haven't included the lower layers dealing with the business logic and data access but they are all working as they're supposed to.

Any help will be greatly appreciated. Thanks.
zac
Top achievements
Rank 1
 answered on 18 Jun 2008
3 answers
137 views
I looked at the online demos of this control, section: "Insert/Update/Delete" / "Edit on Double-Click".

I created a project just like that and replaced the Session Data Source with an asp:SqlDataSource.
The latter does not take the argument PrimaryKeyFields which is set to "OrderID,ProductID" in the original data source.
Because of this (I assume), I get the error...

Unable to update Orders. Reason: Must declare the variable '@OrderID'.

..when trying to update. I am using the Northwind SQL database I have made no changes in the select or update command. How do I use this control with an asp:SqlDataSource?
  
Daniel
Telerik team
 answered on 18 Jun 2008
6 answers
174 views
Hello telerik support team,

I have a problem with sorting if I bind an "interface list" to the radgrid. E.g. I have the following code:
AppUser.cs:
class AppUser : IAppUser
{
public string Account { get; set; }
    public string Password { get; set; }
}

Person.cs
class Person: IPerson
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
}

IAppUser.cs
public interface IAppUser : IPerson
{
string Account { get; set; }
string Password { get; set; }
}

IPerson.cs
public interface IPerson
{
    string FirstName { get; set; }
    string LastName { get; set; }
}

grid.aspx:
<asp:ScriptManager ID="scriptManager" runat="server"></asp:ScriptManager>
<telerik:RadGrid ID="dgAppuser" runat="server" AutoGenerateColumns="false" AllowSorting="true">
<MasterTableView AllowNaturalSort="false">
<Columns>
<telerik:GridBoundColumn HeaderText="Account" DataField="Account"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Password" DataField="Password"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="First Name" DataField="FirstName"></telerik:GridBoundColumn>
<telerik:GridBoundColumn HeaderText="Last Name" DataField="LastName"></telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>

grid.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
dgAppuser.NeedDataSource += new Telerik.Web.UI.GridNeedDataSourceEventHandler(dgAppuser_NeedDataSource);
}
void dgAppuser_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
dgAppuser.DataSource = AppUser.GetAll();
}
The AppUser.GetAll() method returns an IList<IAppUser> object.
When I bind the list to the grid, the binding works, but if I try to sort by the property FirstName or LastName I get the following error:
IndexOutOfRangeException: Column LastName was not found.

If the GetAll() method returns IList<AppUser> instead of IList<IAppUser> the sorting is works.

Is there a solution for this problem or must I add all properties from the base interface also to the derived interface?

Thanks in advance.

Thomas Mayer
Rosen
Telerik team
 answered on 18 Jun 2008
2 answers
166 views
I need to create a custom button for the radeditor and could do with some support.

Basically I'm using the editor to write articles which need to be linked to each other. Rather than having to find the URL of each page the end user wants to link articles too, I need a way of displaying a list of the articles in a window which appears when you click the custom button.

The user could type '(see here)' then highlight the text, click on the button which opens up a dropdown list of all the articles. They then select an article and it automatically makes the link.

Is this is a possibility and how could I do this? Any working examples of something like this would be most appreciated.
Curt
Top achievements
Rank 1
 answered on 18 Jun 2008
1 answer
138 views
Hi,

We are having a strange error.

ScriptLoadFailedException.  The script /Telerik.Web.Ui.WebResource.axd..........

Missing call to Sys.Application.notifyScriptLoaded.

The error is only happening for specific users on our network in IE6.  On one machine the app works fine logged in as me but when logged in as someone with less permissions on the same machine we recieve the above message.

From my understanding it comes from either invalid JS or missing the below.

if( Sys && Sys.Application ){

Sys.Application.notifyScriptLoaded();

}

But..........


Why would this message be privelage specific??????  If it works for one user it should work for them both.

Has anybody experienced this before.

Thanks for any help.

Peter
Telerik team
 answered on 18 Jun 2008
1 answer
117 views
I see the documentation in the help file on implementing the radiobutton function in the RadTreeView control. That's great! Is there any way to actually display a radio button (instead of checkbox) for the control?

Thanks.
Veselin Vasilev
Telerik team
 answered on 18 Jun 2008
2 answers
112 views
hi. New to these controls but wondering if possible to somehow set a default telerik skin somewhere... ie the web.config or seperate class file.
I would like to be able to just use the ctrls without needing to set the skin each time. this seems contrary to logical UI development, where I would just change the css.
Sorry if this question seems to answer itself but I can't see the solution.
 
Please note I am not uber technical so samples are greatly, greatly appreciated.
thanks
mac
Top achievements
Rank 1
 answered on 18 Jun 2008
1 answer
117 views
Hello 

Its been almost 11/2 yr now i have been using Telerik Controls and its amazing
Do you support Controls which work on Iphone or any Mobile Web Application

If so can you send me some online demos

Thanks
Kavya
Vlad
Telerik team
 answered on 18 Jun 2008
1 answer
166 views
Hi
I am using radtooltipmanager loading with the usercontrol  files
I am opening the tooltip with click of the hyperlink
i am also using eworld controls which has masked textbox control
the problem is the eworld controls are not working when i use tooltipmanager

Instead i use to load the same controls in tooltip, in that case its working. But the controls are not working when i used to open the same page using tooltipmanager

I am struct up with this, it will be greatful if someone give any idea on this
Svetlina Anati
Telerik team
 answered on 18 Jun 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?