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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

scheduleControl sql my form

Thread ID:

Created:

Updated:

Platform:

Replies:

149281 Nov 20,2019 01:38 PM UTC Nov 22,2019 10:02 AM UTC WinForms 3
loading
Tags: ScheduleControl
Gregory Pe
Asked On November 20, 2019 01:38 PM UTC

Hi
1. I need to run my Form301
and perform operations add delete change
on dstest007ce.Tables ["ScheduleData"];
2. how to connect it to gridGroupingControl1 so that the changes are visible after each change

Regards,
Gregory

Attachment: c_test2c_d414cfb0.rar

Arulpriya Ramalingam [Syncfusion]
Replied On November 21, 2019 09:01 AM UTC

Hi Gregory, 
 
Thank you for using Syncfusion support. 
 
The GridGroupingControl control does not have support to add records programmatically at run time. However, it updates the records whenever the binding source is updated and we would suggest you to add/delete the rows from the binding source dstest007ce.Tables[“ScheduleData”] to reflect the changes in Grid. Please make use of the below code to update the records in datatable. 
 
Code example 
 
private void ADD_button_Click(object sender, EventArgs e) 
{ 
 
    // Obtain a new DataRow object from the DataTable. 
    drCurrent = table.NewRow(); 
 
    // Set the DataRow field values as necessary. 
    drCurrent["EndTime"] = this.EndTime_dateTimePicker.Value; 
    drCurrent["LocationValue"] = this.LocationValue_textBox.Text; 
    drCurrent["StartTime"] = this.StartTime_dateTimePicker.Value; 
    drCurrent["Subject"] = this.Subject_textBox.Text; 
    //Code to set values for all the columns. 
    table.Rows.Add(drCurrent); 
} 
 
private void DELETE_button_Click(object sender, EventArgs e) 
{ 
    string key = this.Subject_textBox.Text; 
    drCurrent = table.Rows.Find(key); 
    drCurrent.Delete(); 
} 
 
 
Note: Ensure to add the UniqueID as primarykey and get the id when Delete button clicked. 
 
Arulpriya 


Gregory Pe
Replied On November 21, 2019 10:24 AM UTC

Hi Gregory, 
 
Thank you for using Syncfusion support. 
 
The GridGroupingControl control does not have support to add records programmatically at run time. However, it updates the records whenever the binding source is updated and we would suggest you to add/delete the rows from the binding source dstest007ce.Tables[“ScheduleData”] to reflect the changes in Grid. Please make use of the below code to update the records in datatable. 
 
Code example 
 
private void ADD_button_Click(object sender, EventArgs e) 
{ 
 
    // Obtain a new DataRow object from the DataTable. 
    drCurrent = table.NewRow(); 
 
    // Set the DataRow field values as necessary. 
    drCurrent["EndTime"] = this.EndTime_dateTimePicker.Value; 
    drCurrent["LocationValue"] = this.LocationValue_textBox.Text; 
    drCurrent["StartTime"] = this.StartTime_dateTimePicker.Value; 
    drCurrent["Subject"] = this.Subject_textBox.Text; 
    //Code to set values for all the columns. 
    table.Rows.Add(drCurrent); 
} 
 
private void DELETE_button_Click(object sender, EventArgs e) 
{ 
    string key = this.Subject_textBox.Text; 
    drCurrent = table.Rows.Find(key); 
    drCurrent.Delete(); 
} 
 
 
Note: Ensure to add the UniqueID as primarykey and get the id when Delete button clicked. 
 
Arulpriya 


Hi Arulpriya ,

Thank you for your answer

1. how to get information in Form301, what record should I edit after clicking (Edit Item menu) in scheduleControl1
to complete form 301.

2. when I set the scheduleControl1 view to "Dey"
and mark free e.g. 3 hours (date range)
and click (New Item menu) on scheduleControl1
how to get information in Form301 (date range) to complete the 301 form with dates I have chosen before
StartTime_dateTimePicker
EndTime_dateTimePicker

Regards,
Gregory

Arulpriya Ramalingam [Syncfusion]
Replied On November 22, 2019 10:02 AM UTC

Hi Gregory, 
 
Thank you for the update. 
 
how to get information in Form301, what record should I edit after clicking (Edit Item menu) in scheduleControl1 
to complete form 301. 
e.Item of ShowingAppointmentForm will hold the values (start/End time, reminder value, etc.) of the appointment to be edited. Please refer to below KB to get item values. 
 
Code example 
 
void scheduleControl1_ShowingAppointmentForm(object sender, ShowingAppointFormEventArgs e) 
{ 
    //Cancel the default appointform for schedule control 
    e.Cancel = true; 
    //Shows the Custom appointment form 
    IScheduleAppointment appointment = e.Item; 
    //To parder the appointment 
    Form301 ChildForm = new Form301(appointment);        
    ChildForm.Show(); 
} 
public Form301(IScheduleAppointment appointment) 
{ 
    InitializeComponent(); 
    this.StartTime_dateTimePicker.Value = appointment.StartTime; 
    this.EndTime_dateTimePicker.Value = appointment.EndTime; 
    //Code for all the label and textboxes 
} 
 
2. when I set the scheduleControl1 view to "Dey" 
and mark free e.g. 3 hours (date range) 
and click (New Item menu) on scheduleControl1 
how to get information in Form301 (date range) to complete the 301 form with dates I have chosen before 
StartTime_dateTimePicker 
EndTime_dateTimePicker 
PerformNewItemClick() method of ScheduleGrid can be used to get the selected range of dates. Please refer forum for further reference. 
 
 
 
Please get back to us, if you have any other queries. 
 
Regards, 
Arulpriya 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon