The Dev control uses 1:aspxgridview

Source: Internet
Author: User

Dev is a more well-known third-party control, but Baidu, do not find much useful information, here I summarize their use of the process used in the control, I hope everyone less detours, I use the dev version 11.1.

The GridView should be the most frequently used data display control in the encoding process, so write this control today.

I. Preparation prior to use:

1. You need to add four references before use, or drag and drop in the error:

2. Drag in a control, run directly, error, hint Aspxclientgridview undefined, check the dev official website above reply, need to register Aspxhttphandlemodule:

Workaround, add the following in Webconfig system.web:

"DevExpress.Web.ASPxClasses.ASPxHttpHandlerModule, devexpress.web.v11.1, version=, Culture=neutral, publickeytoken=b88d1754d700e49a"name="Aspxhttphandlermodule"/>"aspxuploadprogresshandlerpage.ashx"verb="Get,post"Type="DevExpress.Web.ASPxUploadControl.ASPxUploadProgressHttpHandler,DevExpress.Web.v11.1, version=, Culture=neutral, publickeytoken=b88d1754d700e49a"validate="false"/>< add path="Reserved.ReportViewerWebControl.axd"verb=" *"Type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms,version=, Culture=neutral, publickeytoken=b03f5f7f11d50a3a"validate=" false"/>

Two. Set up data binding:

Self-increment ordinal column in 1.gridview, using Container.itemindex:

<dx:gridviewdatatextcolumn Caption =" rank ">          <DataItemTemplate>                1 %>          </DataItemTemplate></dx:GridViewDataTextColumn>

2. Attributes (take Gridviewdatatextcolumn as an example):

FieldName: Binding the property value of a data sourceVisibleindex: The order of the displayed more properties later supplements ... 3. Event:3.1 onhtmldatacellpreparedloop through each data cell, excluding headings, typically used to set cell stylesE.cell.attributes.add ("style", "Padding-left:" + paddingleft.tostring () + "PX;");To set cells to merge horizontally:E.cell.columnspanTo set up a vertical cell merge:E.cell.rowspan3.2 OnafterperformcallbackThe GridView page refreshes the data, calling the GridView Refresh method to execute the event. 4. About the use of column header templates:4.1 Definition of the template:
classMyheadertemplate:itemplate {//you can add property pass parameters in         Public stringName {Get;Set; } /// <summary>        ///Initialize Method/// </summary>        /// <param name= "container" >controls to add a template</param>         Public voidInstantiateIn (Control container) {Aspxlabel Lbldetail=NewAspxlabel (); Lbldetail.text= name+"\ r View Details"; LBLDETAIL.ATTRIBUTES.ADD ("style","Cursor:pointer;"); LblDetail.ClientSideEvents.Click="ShowDetail"; Container.        Controls.Add (Lbldetail); }    }

4.2 Templates are used by the GridView column:

Newnew   "C-ROM" == = = Playerlist;gvplayerlist.databind ();

Three. Problems encountered:

1. In the case of a fixed column, when the scroll bar appears, Tab can not let the scroll bar with the cursor scrolling, this went to the dev forum checked, their after-sales said cannot solve.

Properties for fixed columns:Fixedstyle="left"This is the first to come here, and later to add ...

The Dev control uses 1:aspxgridview

Related Article

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: 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.