Wednesday, July 23, 2008

CreateChildView

DataRowView.CreateChildView Method ( String )

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 ( );
}
}

www.visli.com

No comments: