ComponentOne AutoComplete for ASP.NET Web Forms
Task-Based Help / Using the LoadOnDemand Property
In This Topic
    Using the LoadOnDemand Property
    In This Topic

    The LoadOnDemand property allows you to retrieve data dynamically. The child items are loaded when the user begins typing in the search box.

    Complete the following steps:

    1. Right-click on the App_Data folder in the Solution Explorer and select Add | Existing Item from the list.
    2. Locate the C1Nwind.mdb database in your ComponentOne Samples folder and click Add to add the database to your project.
    3. Select the C1AutoComplete control in your project.
    4. Click the smart tag button to open the C1AutoComplete Tasks menu.
    5. Click the arrow on the Choose Data Source drop-down list and select New Data Source from the list. This will open the Data Source Configuration Wizard.
    6. Select SqlDatabase from the list and click OK. In the Choose Your Data Connection window, use the drop-down menu to choose C1Nwind.mdb as your data connection and click Next.
    7. In the Configure Select Statement window, select Products from the drop-down list under Specify columns from a table or view and click Next.
    8. Click Test Query to make sure the database is properly queried and then click Finish.
    9. Select the C1AutoComplete control in your project and then navigate to the Properties window.
    10. Locate the LoadOnDemand property in the Properties window and set it to True.
    11. Still in the Properties window, locate the MaxCount property and set it to 5. This property will limit the number of search results in the AutoComplete and must be used with the LoadOnDemand property.
    12. Press F5 to run your application and type "E" into the search box. The results should resemble the following image:

      C1AutoComplete