DataGrid full contact under WebForm

xiaoxiao2021-03-06  51

Several important properties of DataGrid

AutoGenerateColumns: This property indicates whether the DataGrid column is automatically generated. When this value is "True", when the DataGrid.Database () method is executed, all field data in the data source generates a DataGrid column. Even if you have already designated a number of BoundColumn, he will not add all the field columns on the right side of the specified column. So, when you design the binding column, you must set the value of this property to "false".

ALLOWPAGING: This property indicates whether a paging method is used. When this value is "false", DataGrid will arrange all the lines in DataSource. So when the data is a number of rows, it is best to set this property to "True". There is a PageSize property associated with this property indicating how many rows per page. The AllowCustomPaging property indicates whether to make support for custom paging.

2. Use the "Attribute Builder" to design the DataGrid.

After adding a DataGrid control to the web page, the lower corner of its property bar has the link word of the "Properties Builder", click on the pop-up attribute generator. It also contains several functional pages, using attribute generators to complete most of the control design. Other feature pages do not have to be introduced, here briefly introduces a list of generated wizards.

The top is a selection box that indicates whether the column is automatically created at runtime, and actually corresponds to the above AutoGenerateColumns attribute. Then there is the left and right list boxes, the left is the type of column to add, and the list of added columns is displayed on the right. The steps to create columns are: First select the type of column from the left list box, click ">", and column is added to the right list, and then set the following list attribute values. You can press and down the order of the column. For template columns, the property generator does not generate the template content you want, and must also be manually added to mark language.

转载请注明原文地址:https://www.9cbs.com/read-89360.html

New Post(0)