/// <summary>
/// Binds the group members grid.
/// </summary>
protected void BindLayoutBlocksGrid()
{
pnlBlocks.Visible = false;
int layoutId = PageParameter( "layoutId" ).AsInteger();
if ( layoutId == 0 )
{
pnlContent.Visible = false;
return;
}
var rockContext = new RockContext();
var layout = LayoutCache.Read( layoutId, rockContext );
if (layout == null)
{
pnlContent.Visible = false;
return;
}
hfLayoutId.SetValue( layoutId );
pnlBlocks.Visible = true;
BlockService blockService = new BlockService( new RockContext() );
gLayoutBlocks.DataSource = blockService.GetByLayout( layoutId ).ToList();
gLayoutBlocks.DataBind();
}