Basic properties of the Aspxgridview control

Source: Internet
Author: User

1.//aspxgridview Reception Get line number

<clientsideevents rowclick= "function (S, e) {

S.getrowkey (E.visibleindex);

}"

/>

2. in the background , bind The column of the GridView

bound columns cannot modify internal properties directly from an object invocation (principle: All columns defined are parent class Gridviewdatacolumn classes, not directly defined subclasses).

such as <gridviewdataComboBoxcolumn>, need to define a background first

Gridviewdatacomboboxcolumn Column1=gridview. columns[" modified column "] as Gridviewdatacomboboxcolumn;

after use column1 to define:column1. Propertiescombobox.datasource=datasource1; (self-defined data source)

Other column types are written in the same way

bind column to write before binding the GridView

3.ASPxGridView Enter the selected row background event must be set <settingsbehavior processselectionchangedonserver= "true"/> Want to refresh the page, Set enablecallbacks= "false"

<settingsbehavior allowfocusedrow= "True" selects the line enablerowhottrack= "true" to follow the mouse move

/>

4.Gridview word than characters display ellipsis

<settingsbehavior allowellipsisintext= "true"/>

5. Drag the width of the column

Settingsresizing-columnresizemode= "Nextcolumn"

6. Allow empty when dropdown box is selected

<propertiescombobox allownull= "true" ></PropertiesComboBox>

var rowindex= grid. Getfocusedrowindex ();//Gets the selected row line number

var rowid= grid. Getrowkey (rowindex);//Get ROWID by line number

sets the value of a column in the modified row Gridapp.seteditvalue (9, names);

Showstatusbar= "Hidden" does not show your own save Cancel button

Settings-gridlines= "None" displays the border of the row and the border of the column

7. When using skin Office365 the horizontal border is not displayed, add the following code in Page_Load to display the border

GrdPeriod.Settings.GridLines = (GridLines) enum.parse (typeof (GridLines), "Both", true);

8.

<dx:gridviewdatatextcolumn caption= "mobile" fieldname= "Phone" >
</dx:GridViewDataTextColumn>

Basic properties of the Aspxgridview control

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.