我正在尝试在Infragistics Hierarchical DataGrid的子带级别设置一些自定义样式和TemplateDataFields。我将控件绑定到具有子列表的IList。当我将其配置为AutoGenerateBands时,该控件将正常工作(显示父表并展开子表)。但我需要在子表上有自定义标头和TemplateDataFields。
这是我的aspx:
<ig:WebHierarchicalDataGrid ID="WebHierarchicalDataGrid1" runat="server" AutoGenerateColumns="false"
AutoGenerateBands="false" DataKeyFields="DataSourceId" Width="700px" Height="700px">
<ExpandCollapseAnimation SlideOpenDirection="Auto" SlideOpenDuration="300" SlideCloseDirection="Auto"
SlideCloseDuration="300" />
<Columns>
<ig:BoundDataField DataFieldName="DataSourceId" Key="DataSourceId" Header-Text="Data Source Id" Hidden="true"/>
<ig:BoundDataField DataFieldName="DataSrc" Key="DataSrc" Header-Text="Data Source" />
<ig:BoundDataField DataFieldName="DataSrcType" Key="DataSrcType" Header-Text="Activity Type" />
<ig:BoundDataField DataFieldName="Reporting" Key="Reporting" Header-Text="Reporting?" />
<ig:BoundDataField DataFieldName="LastUpdtSrc" Key="LastUpdtSrc" Header-Text="Last Update Source" />
<ig:BoundDataField DataFieldName="LastUpdtDate" Key="LastUpdtDate" Header-Text="Last Update Date" />
<ig:TemplateDataField Key="Priority" Header-Text="Priority"> </ig:TemplateDataField>
</Columns>
<Bands>
<ig:Band DataMember="WebHierarchicalDataGrid1" Key="DataSourceId">
<Columns>
<ig:BoundDataField DataFieldName="DataSourceId" Key="DataSourceId" Header-Text="Data Source Id" Hidden="true" />
<ig:BoundDataField DataFieldName="OriginalSrc" Key="OriginalSrc" Header-Text="Original Source" />
<ig:BoundDataField DataFieldName="LastUpdtDate" Key="LastUpdtDate" Header-Text="Last Update Date" />
<ig:BoundDataField DataFieldName="RecordsCount" Key="RecordsCount" Header-Text="Records Count" />
</Columns>
</ig:Band>
</Bands>
<Behaviors>
<ig:Paging PagerAppearance="Bottom" PageSize="50" Enabled="true" />
<ig:Sorting SortingMode="Single" Enabled="true">
</ig:Sorting>
</Behaviors>
</ig:WebHierarchicalDataGrid>
以下是我如何绑定页面加载中的数据:
this.WebHierarchicalDataGrid1.DataSource = GetLastUpdatedEvents().OrderByDescending(x => x.LastUpdtDate);
this.WebHierarchicalDataGrid1.DataBind();
此代码生成格式良好的父表,并在正确的行上显示展开箭头。点击后奶嘴会旋转,但不会显示子表。
非常感谢任何帮助!
谢谢,
- 将会