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

How to open customappointment from a grid

3 Answers 70 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
April
Top achievements
Rank 1
April asked on 11 Apr 2013, 06:26 PM
Hi,

I have created a grid that is bound to a view in my datasource with a list of upcoming appointments that match a certain criteria. I want to be able to double click on one of the rows in the grid and have it automatically open the CustomAppointmentEdit form for that appointment. The only reference I am able to find is for commands in Silverlight, but I am using winforms. Is this possible?

Thanks in Advance!

3 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 12 Apr 2013, 01:36 PM
Hi April,

Thank you for contacting us.

In this scenario you should handle the CellClick event in RadGridView. Then use the Row argument to get the respective row object and to identify the appointment. After that you should call the ShowAppointmentEditDialog method to show the appointment editor. Here is a sample:
void radGridView1_CellClick(object sender, GridViewCellEventArgs e)
{
    if (e.Column.Name == "SomeCell")
    {
        Appointment app = (Appointment)e.Row.DataBoundItem;
        radScheduler1.ShowAppointmentEditDialog(app, app.MasterEvent != null);               
    }
}

I hope this helps.
  
Greetings,
Jack
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
0
April
Top achievements
Rank 1
answered on 12 Apr 2013, 07:15 PM

Thank you for the reply.

I have tried that but unfortunately I am receiving the following exception:

Unable to cast object of type 'System.Data.Unable to cast object of type 'System.Data.DataRowView' to type 'Telerik.WinControls.UI.Appointment'.

Here is my code:

if (e.Column.Name == "Guests") //bound to txtSubject

 

 

{

 

Appointment app = (Appointment)e.Row.DataBoundItem;

radScheduler1.ShowAppointmentEditDialog(app, app.MasterEvent != null);

Im sure I am missing something obvious but any help would be appreciate

 

 

 

 

 


0
Jack
Telerik team
answered on 16 Apr 2013, 01:37 PM
Hi April,

Thank you for writing back.

I was not aware of the nature of your data source. Therefore I assumed that RadGridView contains Appointment elements for simplicity. You should adjust the code to your data. You can find the Appointment by using its UniqueId property for example. I will be able to give more precise suggestions when I know your scenario in detail.

Could you, please open a support ticket and send me a sample project that demonstrates your scenario. I will be glad to help further.

I am looking forward to your reply.
 
All the best,
Jack
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
Scheduler and Reminder
Asked by
April
Top achievements
Rank 1
Answers by
Jack
Telerik team
April
Top achievements
Rank 1
Share this question
or