开发者

Infragistics WebHierarchicalDataGrid - Custom style on child bands when Databind to IList?

开发者 https://www.devze.com 2023-03-08 11:35 出处:网络
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

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:Bo开发者_如何转开发undDataField  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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号