Ensure first tablerow is header after save too

After the document type, media type or member type is saved, this will
ensure first tablerow is a tableheader, so sorting is limited to <tbody>
This commit is contained in:
bjarnef
2015-01-20 02:10:20 +01:00
parent 9ced66f208
commit 8393465e8a
2 changed files with 13 additions and 2 deletions

View File

@@ -25,7 +25,7 @@
<cc2:Pane ID="Pane1" runat="server" Width="216" Height="80">
<asp:DataGrid ID="dgTabs" Width="100%" runat="server" CellPadding="2" HeaderStyle-CssClass="propertyHeader"
ItemStyle-CssClass="propertyContent" GridLines="None" OnItemCommand="dgTabs_ItemCommand" OnPreRender="dgTabs_PreRender"
ItemStyle-CssClass="propertyContent" GridLines="None" OnItemCommand="dgTabs_ItemCommand" OnItemDataBound="dgTabs_ItemDataBound" OnPreRender="dgTabs_PreRender"
HeaderStyle-Font-Bold="True" AutoGenerateColumns="False" CssClass="tabs-table">
<Columns>
<asp:BoundColumn DataField="id" Visible="False"></asp:BoundColumn>

View File

@@ -43,6 +43,17 @@ namespace Umbraco.Web.UI.Umbraco.Controls
table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter;
}
}
protected void dgTabs_ItemDataBound(object sender, DataGridItemEventArgs e)
{
Table table = dgTabs.Controls[0] as Table;
if (table != null && table.Rows.Count > 0)
{
if (dgTabs.ShowHeader)
table.Rows[0].TableSection = TableRowSection.TableHeader;
if (dgTabs.ShowFooter)
table.Rows[table.Rows.Count - 1].TableSection = TableRowSection.TableFooter;
}
}
}
}