. Net ASPxGridView Use note, aspxgridview

Source: Internet
Author: User

. Net ASPxGridView Use note, aspxgridview
Statistical summary:TotalSummaryAttribute: This attribute must be set.KeyFieldNameAttribute;SettingsInShowFooterSet propertyTrue.DisplayFormat: Same as in. netString. FormatThe usage is basically the same. For example: Total {0. You can set the number of decimal places when the statistical mode is displayed.Setting Method: Total: {0 :#.##}. The "#" before the vertex indicates the integer part, and the "#" after the vertex indicates the number of decimal places reserved.FieldName: Set the fields to be calculated.ShowInColumn: Column to be displayed.ShowInGroupFooterColumn: Column of the group.SummaryType: Statistical method. Sum: and calculation; Min: Minimum value; Max: maximum value. Count: Count; Average: Average. Custom: Custom; None: default.

Default group settings: Method 1: gdvlist. groupBy (GridViewDataColumn) gdvlist. columns ["ColName"]); // enables the table to be automatically grouped by a column by default. Method 2: add the GroupIndex attribute to the table control. For example: <dx: gridViewDataTextColumnCaption = "name" FieldName = "PStepName" VisibleIndex = "0"GroupIndex = "0"> </Dx: GridViewDataTextColumn>

Default filtering settings: gridlist. FilterExpression = "bound field name = 'filtered content '";

 


How does ASPXGridView activate its RowInserting and other events in net MVC? Previously, it can be activated in the cs file,

Mvc. You use Controller ,.. You cannot use controls in the View. If you want to use a function similar to this, a new page should be displayed, and a connection should be bound to a column.

How to add an Sn column for ASPxGridView

Speaking of this, I believe that many of my friends are familiar with. net. This article will be detailed by Dana lecturers about the relevant knowledge. Like the GridView control, AspxGridView is a control that operates the list data of a large amount of data. So how do we add an sequence number column for The AspxGridView control like the GridView control? Just like this: with the serial number column, you can quickly locate the data you want and add a lot to your experience. 1. First, add the sequence number column for AspxGridView // <summary>
/// Add the sequence number column for AspxGridView and the attachment quantity Column
/// </Summary>
/// <Param name = "_ grid"> </param>
Public void SetGridAddNumberCol (AspxGridView _ grid) {if (_ grid! = Null) {if (_ grid. Columns ["no."] = null) {GridViewDataTextColumn col = new GridViewDataTextColumn ();
Col. HeaderStyle. HorizontalAlign = HorizontalAlign. Center;
Col. CellStyle. HorizontalAlign = HorizontalAlign. Center;
Col. EditFormSettings. Visible = DevExpress. Web. ASPxClasses. DefaultBoolean. False;
Col. Caption = "no ";
Col. VisibleIndex = 0;
_ Grid. columns. add (col); // It is mainly used to set the display sequence of the sequence number column. We always want the sequence number column to display at the beginning of the list, but if there is another selection column before, the sequence number column should be behind the selected column, that is, the second column. Of course, this code can be modified or completely deleted as needed.
Bool isvisible;
If (_ grid. Columns [0]. GetType (). Name! = "GridViewCommandColumn") {for (int I = 0; I <_ grid. columns. count; I ++) {if (_ grid. columns [I]. caption = "no ")
_ Grid. Columns [I]. VisibleIndex = 0; else {isvisible = _ grid. Columns [I]. Visible;
_ Grid. Columns [I]. VisibleIndex = _ grid. Columns [I]. VisibleIndex + 1;
_ Grid. columns [I]. visible = isvisible ;}}}two, after adding the post-order, you also need to assign a value to the column. Of course, this is quite simple, we only need to assign a value for the "Serial Number" field in the Grid_HtmlDataCellPrepared event of AspxGridView. The Code is as follows: protected void Grid_HtmlDataCellPrepared (object sender, AspxGridViewTableData ...... remaining full text>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.