Copyright Accelerated Ideas 2007 Legacy Blog Posts | Blog Home | .NET Components

AITaskList - How can I create a new item in the list?


1/2/2007

New task items are added by first creating a new AITaskItem object and adding it to the AITaskList strongly typed collection.

First lets look at how we create a AITaskItem object:

aiTaskItem aItem = new aiTaskItem();


It’s a simple as that, we use the ‘new’ keyword to create an empty AITaskItem. This object is created with the default properties and isn’t much use at this stage, especially since we haven’t added it to the TaskList.

Now, let’s set some of the AITaskItem details:

aItem.Title = “New Item”;
aItem.Description = “This is a new item test”;
aItem.Expanded = false;
aItem.StyleType = aiTaskItem.AIStyleTypes._XP;


In this case we have set the title, description, and style type. We have also set that this task item should not be expanded in the list.

So, now we have a new TaskItem but we must add it to the TaskList before its of any use:

aiTaskList1.AddTaskItem(aItem);


For more information on the features of AITaskList refer to the readme.htm file included in the download.


< Blog Home