This is a migrated thread and some comments may be shown as answers.

Exclude control from Ajax

2 Answers 39 Views
Sharepoint Integration
This is a migrated thread and some comments may be shown as answers.
vairam
Top achievements
Rank 1
vairam asked on 01 Jul 2009, 06:15 AM
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 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 01 Jul 2009, 07:44 AM
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.
0
vairam
Top achievements
Rank 1
answered on 01 Jul 2009, 10:02 AM
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
Tags
Sharepoint Integration
Asked by
vairam
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
vairam
Top achievements
Rank 1
Share this question
or