RadGrid for ASP.NET

RadGrid Send comments on this topic.
MasterTableView Property
See Also 
Telerik.WebControls Namespace > RadGrid Class : MasterTableView Property


The instance of GridTableView that represents the main grid-table view in RadGrid.   

 

Namespace: Telerik.WebControls
Assembly: RadGrid (in RadGrid.dll)

Syntax

Visual Basic (Declaration) 
Public Overridable ReadOnly Property MasterTableView As GridTableView
Visual Basic (Usage)Copy Code
Dim instance As RadGrid
Dim value As GridTableView
 
value = instance.MasterTableView
C# 
public virtual GridTableView MasterTableView {get;}

Return Value

A reference to the topmost GridTableView, i.e the MasterTableView.

Example

            <rad:radgrid id="RadGrid1" runat="server"
CssClass= "RadGrid" Width="100%" AutoGenerateColumns="False" PageSize="3" AllowSorting="True"
AllowMultiRowSelection= "False" AllowPaging="True" GridLines="None" AllowFilteringByColumn="true">
<PagerStyle Mode="NumericPages" CssClass="Pager"></PagerStyle>
<HeaderStyle CssClass="Header"></HeaderStyle>
<ItemStyle CssClass="Row"></ItemStyle>
<AlternatingItemStyle CssClass="AltRow"></AlternatingItemStyle>
<MasterTableView DataKeyNames="CustomerID" AllowMultiColumnSorting="True">
<DetailTables>
<rad:GridTableView DataKeyNames="OrderID" DataMember="Orders">
<ParentTableRelation>
<rad:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
</ParentTableRelation>
<DetailTables>
<rad:GridTableView DataKeyNames="OrderID" DataMember="OrderDetails">
<ParentTableRelation>
<rad:GridRelationFields DetailKeyField="OrderID" MasterKeyField="OrderID" />
</ParentTableRelation>
<Columns>
<rad:GridBoundColumn SortExpression="UnitPrice" HeaderText="Unit Price" HeaderButtonType="TextButton"
DataField= "UnitPrice">
</rad:GridBoundColumn>
<rad:GridBoundColumn SortExpression="Quantity" HeaderText="Quantity" HeaderButtonType="TextButton"
DataField= "Quantity">
</rad:GridBoundColumn>
<rad:GridBoundColumn SortExpression="Discount" HeaderText="Discount" HeaderButtonType="TextButton"
DataField= "Discount">
</rad:GridBoundColumn>
</Columns>
<SortExpressions>
<rad:GridSortExpression FieldName="Quantity" SortOrder="Descending"></rad:GridSortExpression>
</SortExpressions>
<ItemStyle BackColor="#A7B986"></ItemStyle>
<HeaderStyle CssClass="Header1"></HeaderStyle>
<AlternatingItemStyle BackColor="#D9E8C4"></AlternatingItemStyle>
</rad:GridTableView>
</DetailTables>
<Columns>
<rad:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"
DataField= "OrderID">
</rad:GridBoundColumn>
<rad:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton"
DataField= "OrderDate">
</rad:GridBoundColumn>
<rad:GridBoundColumn SortExpression="EmployeeID" HeaderText="EmployeeID" HeaderButtonType="TextButton"
DataField= "EmployeeID">
</rad:GridBoundColumn>
</Columns>
<SortExpressions>
<rad:GridSortExpression FieldName="OrderDate"></rad:GridSortExpression>
</SortExpressions>
<ItemStyle Height="19px" BackColor="#FCEDB0"></ItemStyle>
<HeaderStyle CssClass="Header2" ForeColor="#ffffff"></HeaderStyle>
<AlternatingItemStyle Height="19px" BackColor="#D5B96A"></AlternatingItemStyle>
</rad:GridTableView>
</DetailTables>
<Columns>
<rad:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" HeaderButtonType="TextButton"
DataField= "CustomerID">
</rad:GridBoundColumn>
<rad:GridBoundColumn SortExpression="ContactName" HeaderText="Contact Name" HeaderButtonType="TextButton"
DataField= "ContactName">
</rad:GridBoundColumn>
<rad:GridBoundColumn SortExpression="CompanyName" HeaderText="Company" HeaderButtonType="TextButton"
DataField= "CompanyName">
</rad:GridBoundColumn>
</Columns>
<SortExpressions>
<rad:GridSortExpression FieldName="CompanyName"></rad:GridSortExpression>
</SortExpressions>
</MasterTableView>
<SelectedItemStyle ForeColor="White" BackColor="DarkBlue" CssClass=""></SelectedItemStyle>
</rad:radgrid>

Remarks

Telerik RadGrid introduces a new approach to hierarchical data structures. The innovative in Telerik RadGrid is having a so called MasterTableView. This is the topmost table of the hierarchical structure. It is a GridTableView with GridTableViewCollection. The collection holds the so called DetailTables - tables related to the fields of the MasterTable. Each DetailTable can have its own GridTableViewCollection with other Detail Tables, thus forming the hierarchical structure. </