cnblogs/dcrenl/.net ASPxGridView 使用手记.html

30 lines
2.3 KiB
HTML
Raw Permalink Normal View History

2024-09-24 12:43:01 +08:00
<div id="sina_keyword_ad_area2" class="articalContent ">统计汇总功能:
<div><strong>TotalSummary</strong>属性:此属性必须设置<strong>KeyFieldName</strong>属性;<strong>Settings</strong>中的<strong>ShowFooter</strong>属性设置为<strong>True</strong></div>
<div><em>DisplayFormat</em>:同.net中的<span style="font-family: Arial; line-height: 18px;"><strong>String.Format</strong></span><span style="font-family: Arial; line-height: 18px;">使用方法基本相同。例如:总计{0}个。此处可以设置统计方式显示时的小数位数等。<strong>设置方法</strong>:总计:{0:</span><span>#.##}。其中的点前面的&ldquo;#&rdquo;表示整数部分;后面的&ldquo;#&rdquo;表示保留小数位数。</span></div>
<div><span style="font-family: Arial; line-height: 18px;"><span style="font-family: 宋体,Verdana,Arial,Helvetica,sans-serif; line-height: 21px;"><em>FieldName</em></span>:设置需要统计的字段。</span></div>
<div><em>ShowInColumn</em><span style="font-family: Arial; line-height: 18px;">:需要显示在哪一列。</span></div>
<div><em>ShowInGroupFooterColumn</em><span style="font-family: Arial; line-height: 18px;">:分组时显示在哪一列。</span></div>
<div><em>SummaryType</em><span style="font-family: Arial; line-height: 18px;">统计方式。Sum和计算Min最小值Max最大值。Count计数Average平均值。Custom自定义None默认。</span></div>
<div><span style="font-family: Arial; line-height: 18px;"><br />
</span></div>
<div><span style="font-family: Arial; line-height: 18px;"><br />
</span></div>
<div><span style="font-family: Arial; line-height: 18px;">默认分组设置:</span></div>
<div><span style="line-height: 18px;">方法1</span></div>
<div>&nbsp;gdvlist.GroupBy((GridViewDataColumn)gdvlist.Columns["ColName"]);//使表格默认按某一列自动分组</div>
<div>方法2</div>
<div>&nbsp; 在表格控件中</div>
<div>&nbsp; 添加GroupIndex属性例如</div>
<div>
<div>&nbsp; &lt;dx:GridViewDataTextColumnCaption="名称" FieldName="PStepName" VisibleIndex="0"<strong>GroupIndex="0"</strong>&gt;&lt;/dx:GridViewDataTextColumn&gt;</div>
<div><br />
</div>
<div><br />
</div>
<div>默认筛选设置:</div>
<div>gridlist.FilterExpression = "绑定字段名称 = '筛选内容'";</div>
</div>
</div>
<p>&nbsp;</p>