如何在GridView telerik中添加页脚 [英] How to add Footer in GridView telerik
本文介绍了如何在GridView telerik中添加页脚的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,
我使用c#在Telerik win表格中工作,
我有网格视图,我想添加页脚按下面的锯数计算单位。
我的代码如下。
GridViewSummaryItem summaryItem = new GridViewSummaryItem();
summaryItem.Name = Units;
summaryItem.Aggregate = GridAggregateFunction.Count;
GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem();
summaryRowItem.Add(summaryItem);
this .GridViewWorkInProgress.SummaryRowsTop.Add(summaryRowItem);
this .GridViewWorkInProgress.SummaryRowsBottom.Add(summaryRowItem);
我会抛出NullReference Exception Un错误的错误。
给我解决方案。
谢谢
解决方案
检查这个
< telerik:RadGridView x:名称 = radGridView2 ShowColumnFooters = True CanUserInsertRows = True BorderThickness = 0,1,0,1 GridLinesVisibility = 无 CanUserFreezeColumns = False AutoGenerateColumns = False ItemsSource = {Binding lstOperationProfile} ShowGroupPanel = False IsReadOnly = 错误 >
< telerik:RadGridView.Columns >
< telerik:GridViewDataColumn IsReadOnly = False 宽度 = 200 标题 =跨度> <温泉n class =code-keyword> OperationID DataMemberBinding = {Binding Operation} >
< span class =code-keyword>< telerik:GridViewColumn.Footer >
< telerik:RadButton x:名称 = 添加 内容 = AddNewRow 命令 = telerikGrid:RadGridViewCommands.BeginInsert CommandTarget = {Binding ElementName = radGridView1} / >
< / telerik :GridViewColumn.Footer >
< / telerik:GridViewDataColumn >
< telerik:GridViewDataColumn IsReadOnly = False 宽度 = < span class =code-keyword> 200 标题 = OperationName DataMemberBinding = {Binding TimeHrs} / >
< telerik:GridViewDataColumn IsReadOnly = False 宽度 = 200 标题 = OperationTime DataMemberBinding = {Binding TimePercen} / >
< telerik:GridViewDataColumn IsReadOnly = False 宽度 = 200 标题 < span class =code-keyword> = LoadOnGensets DataMemberBinding = {Binding LoadOnGensets} / >
< telerik:GridViewDataColumn IsReadOnly = False 宽度 = 200 标题 = 总计 DataMemberBinding = {Binding Total} / >
< / telerik:RadGridView.Columns >
< / telerik:RadGridView > 跨度>
Hello,
I am work in Telerik win form using c#,
I have grid view and i want to add footer which calculate the units as per below sawed.
My code as below.
GridViewSummaryItem summaryItem = new GridViewSummaryItem();
summaryItem.Name = "Units";
summaryItem.Aggregate = GridAggregateFunction.Count;
GridViewSummaryRowItem summaryRowItem = new GridViewSummaryRowItem();
summaryRowItem.Add(summaryItem);
this.GridViewWorkInProgress.SummaryRowsTop.Add(summaryRowItem);
this.GridViewWorkInProgress.SummaryRowsBottom.Add(summaryRowItem);
I t will throws the error of NullReference Exception Unhandled.
give me the solution for that.
Thanks
解决方案
CHECK THIS OUT
<telerik:RadGridView x:Name="radGridView2" ShowColumnFooters="True" CanUserInsertRows="True" BorderThickness="0,1,0,1" GridLinesVisibility="None" CanUserFreezeColumns="False" AutoGenerateColumns="False" ItemsSource="{Binding lstOperationProfile}" ShowGroupPanel="False" IsReadOnly="False"> <telerik:RadGridView.Columns> <telerik:GridViewDataColumn IsReadOnly="False" Width="200" Header="OperationID" DataMemberBinding="{Binding Operation}"> <telerik:GridViewColumn.Footer> <telerik:RadButton x:Name="Add" Content="AddNewRow" Command="telerikGrid:RadGridViewCommands.BeginInsert" CommandTarget="{Binding ElementName=radGridView1}" /> </telerik:GridViewColumn.Footer> </telerik:GridViewDataColumn> <telerik:GridViewDataColumn IsReadOnly="False" Width="200" Header="OperationName" DataMemberBinding="{Binding TimeHrs}" /> <telerik:GridViewDataColumn IsReadOnly="False" Width="200" Header="OperationTime" DataMemberBinding="{Binding TimePercen}" /> <telerik:GridViewDataColumn IsReadOnly="False" Width="200" Header="LoadOnGensets" DataMemberBinding="{Binding LoadOnGensets}"/> <telerik:GridViewDataColumn IsReadOnly="False" Width="200" Header="Total" DataMemberBinding="{Binding Total}" /> </telerik:RadGridView.Columns> </telerik:RadGridView>
这篇关于如何在GridView telerik中添加页脚的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文