Irwsoft Web Control

ListBox
Brief Information
DescriptionA selection control with a list of items.
FeaturesSingle and multiple selection.
ListBox control
ListBox control


The ListBox control is a selection control with a list of items. This control have single and multiple selection.

All IWC input control designed using MVVM pattern which mean you can have a data-model class representing a domain/table, but ofcourse you can still using classic CRUD programming without any data-model. You can use simple C# class, Irwsoft Data Framework, Entity Framework, Linq to Sql or other .NET ORM. Then set its data-source and some properties to bind.

Example : Input Country data of Person table with ListBox


C# code for Person table

// 1) Sample code for Person table
public class Person
{
     // 2) The columns of Person table.
     public int ID { get; set;}
     public string FirstName { get; set;}
     public string LastName { get; set;}
     public GenderType Gender { get; set;}
     public DateTime DateOfBirth { get; set;}
     public int Age { get; set;}
     public string Address { get; set;}
     public string City { get; set;}
     public string Country { get; set;}  // 3) Input Gender property of Person.
     public string IdentityCardNo { get; set;}
     public string BioData { get; set;}
     public string PictureUrl { get; set;}
}

ASPX code for ListBox

// 1) Defines the ListBox control
<irw:ListBox ID="LB1" runat="server" SkinStyle="SimpleGrey" Width="250">
     <DataPropertyNames>  // 2) Defines Country propertyto bind inside DataPropertyNames tag
          <irw:DataPropertyName Name="Country" />
     </DataPropertyNames>
     <Header>  // 3) Defines a header for Country name
          <irw:ListTableColumn Caption="Country" Name="Name" Key="true" />
     </Header>
     <Rows>  // 4) Defines Country items
          <irw:ListTableRowItem>
               <irw:ListTableCell>Australia</irw:ListTableCell>
          </irw:ListTableRowItem>
          <irw:ListTableRowItem>
               <irw:ListTableCell>Bahrain</irw:ListTableCell>
          </irw:ListTableRowItem>
          <irw:ListTableRowItem>
               <irw:ListTableCell>China</irw:ListTableCell>
          </irw:ListTableRowItem>
          <irw:ListTableRowItem>
               <irw:ListTableCell>Germany</irw:ListTableCell>
          </irw:ListTableRowItem>
          <irw:ListTableRowItem>
               <irw:ListTableCell>United Kingdom</irw:ListTableCell>
          </irw:ListTableRowItem>
          <irw:ListTableRowItem Selected="true">
               <irw:ListTableCell>USA</irw:ListTableCell>
          </irw:ListTableRowItem>
     </Rows>
</irw:ListBox>


Related Topics :


Irwsoft Data Ultimate Edition 4.0 supports data-schema extension (entity framework, linq to sql, simple class, and etc).