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=11.1.8.0, Culture=neutral, publickeytoken=b88d1754d700e49a"name="Aspxhttphandlermodule"/>"aspxuploadprogresshandlerpage.ashx"verb="Get,post"Type="DevExpress.Web.ASPxUploadControl.ASPxUploadProgressHttpHandler,DevExpress.Web.v11.1, version=11.1.8.0, Culture=neutral, publickeytoken=b88d1754d700e49a"validate="false"/>< add path="Reserved.ReportViewerWebControl.axd"verb=" *"Type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms,version=10.0.0.0, 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