We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Fill records in list of Alertwindow

Hi,
I am saving appointment to schedule control and also in database.
I fetched data and filled the schedule control.But when I checked alert tool strip menu item,it doesn't show me all appointments.
I want to fill all records from schedule control to alert window.
Please suggest any solution.

Thank you and regards,
Paurnima
 

1 Reply

AK Adhikesevan Kothandaraman Syncfusion Team August 21, 2015 12:50 PM UTC

Hi Paurnima,

Thank you for your interest in Syncfusion products.

By default the alert window will shows the old appointments. If you want to show all the appointments in the alert window, you can customize the grid of the AlertWindow using AlertWindow.VisibleChanged event. In this event you can invoke the events of the Grid control like QueryCellInfo, QueryRowCount and QueryColCount in the alert window. By using these grid events you can able to set the data for the alert window. Please refer the  below code snippet,

Code snippet:

//Invoke the event to customize the alert window while showing.

this.scheduleControl1.AlertWindow.VisibleChanged += AlertWindow_VisibleChanged;
this.scheduleControl1.EnableAlerts = true;

void AlertWindow_VisibleChanged(object sender, EventArgs e)

{

     AlertForm form = sender as AlertForm;

     if(form !=null && form.Visible)

     {

         form.StartPosition = FormStartPosition.CenterParent;

         form.buttonDismiss.BackColor = Color.LightPink;               

         //Invoke this event to set the Row count of the grid control

         form.Grid.QueryRowCount += Grid_QueryRowCount;

         //Invoke this event to set the Col count of the grid control

         form.Grid.QueryColCount += Grid_QueryColCount;

         //Invoke this event to set the values of the grid

         form.Grid.QueryCellInfo += Grid_QueryCellInfo;        

     }

}


void Grid_QueryColCount(object sender, GridRowColCountEventArgs e)

{

     e.Count = 2;

     e.Handled = true;

}

ArrayListDataProvider list;


void Grid_QueryRowCount(object sender, GridRowColCountEventArgs e)

{

     list = this.scheduleControl1.DataSource as ArrayListDataProvider;

     e.Count =list.MasterList.Count;

     e.Handled = true;

}


void Grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)

{

     if (list != null && e.RowIndex > 0 && e.ColIndex > 0 && e.RowIndex <= list.MasterList.Count)

     {

         IScheduleAppointment item = list.MasterList[e.RowIndex - 1] as IScheduleAppointment;

         if (item != null)

         {

             if (e.ColIndex == 1)

             {

                 e.Style.Text = item.Subject;

             }

             else if (e.ColIndex == 2)

             {

                 TimeSpan ts = item.StartTime - DateTime.Now;

                 e.Style.Text = ts.ToString();

             }

         }

     }         
 }

Sample:
http://www.syncfusion.com/downloads/support/forum/119987/ze/AlertWindowCustomization1686939868

Please let me know if you have any concern.

Regards,
Adhi.


Loader.
Live Chat Icon For mobile
Up arrow icon