Using IsCriteria Attribute to specify fields as criteria - DataForm.NET Samples

This example illustrates how to add additional fields to Criteria for assistant purpose. But they are used as criterias.

Pick a Theme:

Product CategoryProduct
Order Date  ~  
  
Product CategoryProduct
Order Date  ~  
    

Click Search button and see the criteria Values:


  Design   Source  
  1. Open DataForm.NET Manager. In DataForm.NET List page, choose Invoices by clicking the link.
  2. In the DataForm.NET Designer on the right hand side, switch to Criteria tab.
  3. The ProductID and OrderDate fields are the columns from Invoices view which are used as criterias. The CategoryID is an additional field which is not a criteria. It is used for populating ProductID field which is a dropdown list.
  4. Click CategoryID link to bring up the Criteria Field Designer window. CategoryID is a dropdown list field which uses a SQL command as datasource, "select categoryname, categoryid from categories". The AutoPostBack checkbox is checked and Product field is chosen in the Affiliate Fields listbox, which means when CategoryID field postbacks to server, it will populate Product(ProductID) field by the selected value.
  5. Click ProductID link at the left side. ProductID field is dropdown list as well. It also uses SQL command to populate its items, "select productname, productid from products where productid={criteria!categoryid}". {criteria!categoryid} means it will get the selected value from CategoryID field.
  6. Click OrderDate link at the left side. Operator is using Between.
  • Click HERE to open up a READ ONLY DataForm.NET Manager.
  • Click HERE to try for yourself.