LiveGrid Functionality

The LiveGrid implements great deal of functionality but most of it is pretty straight forward so only the key elements will be exposed here.

Column Mapping

The grid supports 2 types of column mapping: simple field mapping where you just provide a FieldName for a grid column to bound to and a formatting expression and that's it; the other type of mapping is used for complex scenarios where the grid column is a mix of more than just one field and is called expression mapping. The Expression is a typical string.Format expression where the bracket arguments are passed from the ExpressionFieldNames values, the order here being important.

<piece:LiveGridColumn HeaderText="Full name">
    <Mapping MappingType="Expression">
        <ExpressionMapping Expression="{0}, {1}" ExpressionFieldNames="FamilyName,FirstName" />
    </Mapping>                    
</piece:LiveGridColumn>
<piece:LiveGridColumn HeaderText="Age">
    <Mapping MappingType="Field">
        <FieldMapping FieldName="Age" />
    </Mapping>
</piece:LiveGridColumn>

Column Actions

Custom server actions can be defined in LiveGrid. For this a __command(string,string) js function is provided where the first parameter is the command name and the second is the command parameter. The server receives the action request before the data needed event so the data can be manipulated accordingly.

<piece:LiveGridColumn>
    <Mapping MappingType="Expression">
        <ExpressionMapping 
            Expression='<a href="javascript:__command('Delete','{0}');">Del</a>' 
            ExpressionFieldNames="Id" />
    </Mapping>
</piece:LiveGridColumn>

Bookmarking

LiveGrid need to use a bookmark feature since the continuous scrolling brings the entire data to the user. The bookmark expression behaves the same way as the ExpressionMapping using brackets parameters; although in this case there should be exactly 3 parameters. The bookmarking supports a paging-like behaviour.

<Bookmarking AllowBookmarking="True" BookmarkExpression="{0} - {1} / {2}" 
    AllowBookmarkScroll="True" />

Grid Rows

The rows can be highlighted and initially scrolled to. More, the length of visible rows can be customized not just by a fixed number but by fitting in an outside container.

<piece:LiveGrid ID="LiveGrid1" runat="server" VisibleRows="FitToWindow">
</piece:LiveGrid>