Infragistics WebHierarchicalDataGrid - 当数据绑定到 IList 时子带上的自定义样式?
我正在尝试在 Infragistics 分层数据网格的子带级别上设置一些自定义样式和 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();
此代码生成一个格式良好的父表,并在正确的行上显示展开箭头。单击后,奶嘴将旋转,但不会显示子表。
任何帮助将不胜感激!
谢谢,
-威尔
I'm trying to setup some custom styles and TemplateDataFields on the child band level of the Infragistics Hierarchical DataGrid. I'm binding the control to an IList which has sub lists. The control will work fine (display the parent table and expand out the child tables) when I configure it to AutoGenerateBands. But I need to be have custom headers, and TemplateDataFields on the child tables.
Here is my 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>
And here is how I bind the data in the Page Load:
this.WebHierarchicalDataGrid1.DataSource = GetLastUpdatedEvents().OrderByDescending(x => x.LastUpdtDate);
this.WebHierarchicalDataGrid1.DataBind();
This code produces a nicely formatted parent table, and displays the expand arrows on the correct rows. Once clicked the pacifier will spin but no child table is displayed.
Any help will be much appreciated!
Thanks,
-Will
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论