Irwsoft Web Control

DataViewTemplate
Brief Information
DescriptionRead only control to display the items from data source with a row-template.
Features
  • Filter/search,
  • Sort,
  • Paging, and
  • Free design for each row.


DataViewTemplate displays ImageGallery

DataViewTemplate
DataViewTemplate control with all features on


The DataViewTemplate control is read only control that displays the items from data source with a row-template. This control allows you to filer/search, and sort these items. The last is paging that allows you to view data in specific size. All these features are available and just need to set on.

The filter, search and paging features are available by default. The Sort feature available in DataViewTemplate by using CommandButton.

Example : Display Person table with DataViewTemplate


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;}
     public string IdentityCardNo { get; set;}
     public string BioData { get; set;}
     public string PictureUrl { get; set;}
}

ASPX code for DataViewTemplate

// 1) Defines the DataViewTemplate control
<irw:DataViewTemplate ID="DVT1" runat="server" SkinStyle="Lime" PageSize="5"
     AllowFiltering="true" AllowSorting="true" AllowPaging="true" EnabledFiltering="true"
     OnDataLoad="DVT1_DataLoad" OnImagePreview="DVT1_ImagePreview" OnFileDownload="DVT1_FileDownload">
     <TitleTemplate>
          <div style="height: 24px;line-height: 24px;vertical-align: middle;">ID</div>
     </TitleTemplate>
     <HeaderTemplate>
          <span style="width: 25px;display: inline-block;">ID</div>
          <span style="padding-left: 10px;width: 200px;display: inline-block;">FirstName LastName</span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;">Gender</span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;">Date Of Birth</span>
          <span style="padding-left: 10px;width: 40px;display: inline-block;">Age</span>
          <span style="padding-left: 10px;width: 200px;display: inline-block;">Address</span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;">City</span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;">Country</span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;">PictureUrl</span>
     </HeaderTemplate>
     <RowTemplate>
          <span style="width: 25px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="25">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="ID" DataType="Integer" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </div>
          <span style="padding-left: 10px;width: 200px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" DataFormat="{0} {1}" Width="200">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="FirstName" />
                         <irw:ViewPropertyName Name="LastName" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="100">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="Gender" DataType="List" Type="WebTest.Data.GenderType" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="100">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="DateOfBirth" DataType="Date" Format="d" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 40px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="40">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="Age" DataType="Integer" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 200px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="200">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="Address" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="100">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="City" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;position: relative;top: 10px;">
               <irw:ReadOnlyText runat="server" Width="100">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="Country" />
                    </ViewPropertyNames>
               </irw:ReadOnlyText>
          </span>
          <span style="padding-left: 10px;width: 100px;display: inline-block;position: relative;top: 10px;">
               <irw:Image runat="server" Height="100" Width="100">
                    <ViewPropertyNames>
                         <irw:ViewPropertyName Name="PictureUrl" DataType="ImageUrl" />
                    </ViewPropertyNames>
               </irw:Image>
          </span>
     </RowTemplate>
     <FooterTemplate>
          <div style="height: 24px;line-height: 24px;vertical-align: middle;text-align: right;">1st September 2016</div>
     </FooterTemplate>
</irw:DataViewTemplate>

Related Topics :


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