Exclude control from Ajax

3 posts, 0 answers
  1. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 01 Jul 2009 Link to this post

    Hi

    I am creating the webpart in share point
    I am having the the Rad schedular in side the Ajax Panel.Every thing is working fine
    I need to acheive the same functionality like this(export to icalandar)
    http://demos.telerik.com/aspnet-ajax/scheduler/examples/export/defaultcs.aspx.
    I tried to export the individual events, at the time i got the error.Because individual item export image button inside the Ajax panel.I need to exclude this image button from Ajax inside the share point.How can i do this?

    Here is my code

     public class AppTemplate : ITemplate

        {
            private DataTable dtfinalResult = new DataTable();
            private ScriptManager _ScriptManager;
            public AppTemplate(DataTable dtResult, ScriptManager ScriptManager)
            {
                dtfinalResult = dtResult.Copy();
                _ScriptManager = ScriptManager;
            }
           
            public void InstantiateIn(Control container)
            {
                ImageButton imgexport = new ImageButton();
                imgexport.CommandName = "Export";
                imgexport.ImageUrl = "/_layouts/images/smallOutlook.gif";
                imgexport.Width = new Unit(20);
                //Exclude from the Ajax
                //_ScriptManager.RegisterPostBackControl(imgexport);
                //imgexport.Attributes.Add("onclick", string.Format("realPostBack(this, \"\"); return false;"));
                    //container.Controls.Add(imgexport);
                Literal subject = new Literal();           
                subject.DataBinding += subject_DataBinding;           
                container.Controls.Add(subject);
                CalendarPlus calendarplus = new CalendarPlus(); 
               
           
            }

            private void subject_DataBinding(object sender, EventArgs e)
            {
                Literal subject = (Literal)sender;
                IDataItemContainer aptContainer = (IDataItemContainer)subject.BindingContainer;

                //Access the appointment object and set its AllowEdit property:
                SchedulerAppointmentContainer aptCont = (SchedulerAppointmentContainer)subject.Parent;
                Appointment app = aptCont.Appointment;
                int APPID = int.Parse(app.ID.ToString());
                app.AllowEdit = false;
                DataView dvFinalresult = dtfinalResult.DefaultView;
                dvFinalresult.RowFilter = "FieldID=" + APPID;
                DataTable dtCurrentApp = dvFinalresult.ToTable();
                DateTime dtevent = DateTime.Parse(dtCurrentApp.Rows[0]["EventDate"].ToString());
                string strSubject = HttpUtility.HtmlEncode((string)DataBinder.Eval(aptContainer.DataItem, "Subject"));
                if (dtCurrentApp.Rows.Count > 0)
                {
                    subject.Text = "<span id=\"spanID\" curDivDate=\"" + dtevent.ToString().Replace("/","_").Replace(" ","_")+ "\" title='' onmouseover=\"wsc_showmenu(this); return false\" ><A  HREF=\"javascript:void(window.open('" + dtCurrentApp.Rows[0]["URL"].ToString().Trim() + "'))\">" + strSubject + "</a></span>";
                }
                else
                {
                    subject.Text = strSubject;
                }
            }
        }



    Regards
    Vairam
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 01 Jul 2009 Link to this post

    Hello vairam,

    Have you tried triggering an explicit postback as shown in the Export javascript method from the online demo? Another approach would be to disable ajax explicitly when the individual buttons are clicked (based on the id of event target clicked by the user) as illustrates on this integration example:

    http://demos.telerik.com/aspnet-ajax/controls/examples/integration/raduploadinajaxifiedgrid/defaultcs.aspx?product=grid (see the Description section and javascript logic for details)

    Thus you should be able to export the scheduler's appointments in iCalendar format.
     
    Best regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.

  3. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 01 Jul 2009 Link to this post

    Hi
    Before i have used the ajax export in my asp.net application it was working fine.
    Inside the share point web part getting the ClientID only the problem.
    Can you give a sample code for export inside the share point webpart.

    Regards
    Vairam
Back to Top