• Binding the Schedule Control to a DataSource [Janus GridEX WinForms Control v3.5 for .NET]

    This tutorial is intended to show you how to bind the Schedule control to a DataSource available at design time.



    Follow these steps to create a simple form using a Schedule control to display records from a table in a database.



    1) Create a new Visual Basic or C# project using "Windows Application" Template



    2) Add a new Data Source to the application:



    Click in the "Add New Data Source..." menu under "Data" and follow the wizard to add "Appointments" table from Schedule.mdb database.



    In the tutorial we used Provider = "Microsoft Access Database File (OLE DB)" and Database file name = "C:\Schedule.mdb".



    3) Build the project to be able to see ScheduleDataSet and AppointmentsTableAdapter as components in the Toolbox.



    4) Drag from the tool box ScheduleDataSet and AppointmentsTableAdapter components to the designer.



    Now that the DataSet has been created, we can start using the TimeLine control in the project.



    5) Add a Schedule Control to a tab in the Toolbox window by right clicking in the Toolbox window and choosing "Choose Items..." menu. When the dialog appears check "Schedule" control in the list and click OK.



    Note: If Schedule control doesn't appear as an option in the list, click the Browse button and open Janus.Windows.Schedule.dll.



    6) Drag a Schedule control from the toolbox into the Form designer.



    7) Select the Schedule control in the Form and set the following properties in the properties window:



    DataSource = scheduleDataSet1

    DataMember = Appointments

    StartTimeMember = StartDate

    EndTimeMember = EndDate

    TextMember = Subject



    8) (Optional) Right click on the Schedule control and select "Retrieve Fields" menu. This action will force the control to read the data source structure and create the fields for the items in the table.



    9) In the Load event of the Form fill the Appointments table in the dataset with the following code:

    In VB.Net

    Me.AppointmentsTableAdapter1.Fill(Me.ScheduleDataSet1.Appointments)


    In C#.Net

    this.appointmentsTableAdapter1.Fill(this.scheduleDataSet1.Appointments)


    10) Press F5 and run the project.

    Source Of Information : Janus v3.5 Help Files for VS 2008