asp.net.ph

DataRowView.CreateChildView Method ( DataRelation )

System.Data Namespace   DataRowView Class


Returns the DataView for the child DataTable with the specified DataRelation.

[ VB ]
Overloads Public Function CreateChildView ( _
   ByVal relation As DataRelation _
) As DataView

[ C# ]
public DataView CreateChildView (
   DataRelation relation
);

[ C++ ]
public: DataView* CreateChildView (
   DataRelation* relation
);

[ JScript ]
public function CreateChildView (
   relation : DataRelation
) : DataView

Parameters

relation
The DataRelation object.

Example

The following example demonstrates using the CreateChildView method to specify the data source for a DataGrid control nested within a parent DataList control.

void getChildSource ( Object src, DataListItemEventArgs e ) {
   if ( e.Item.ItemType == ListItemType.SelectedItem || 
         e.Item.ItemType == ListItemType.AlternatingItem ) {
      DataGrid childGrid = ( DataGrid ) e.Item.FindControl ( "Products" );
      childGrid.DataSource = ( ( DataRowView ) e.Item.DataItem ).CreateChildView ( "categoryId" );
      childGrid.DataBind ( );
   }
}

 Show me 

See Also

DataRowView Members   DataRowView.CreateChildView Overload List Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph