Research on c1TrueDBGrid in C #

Source: Internet
Author: User

(1) // c1TrueDBGrid sets whether a column is displayed.
This. c1TrueDBGrid1. Splits [0]. DisplayColumns ["fieldName"]. Visible = false;
(2) // obtain the current number of lines through c1TrueDBGrid
Int rows = this. c1TrueDBGrid2. Splits [0]. Rows. Count;
(3) // total c1TrueDBGrid practices
. Code written in the load event www.2cto.com
Int rows = this. c1TrueDBGrid1. Splits [0]. Rows. Count;
Int sum1 = 0;
For (int I = 0; I <rows; I ++)
{
String unit1 = this. c1TrueDBGrid1 [I, "aa"]. ToString ();
Sum1 + = Convert. ToInt32 (unit1 );
}
This. c1TrueDBGrid1. Columns ["aa"]. FooterText = sum1.ToString ();
. C1TrueDBGrid1 attribute ColumnFooters is set to true
Or add c1TrueDBGrid1. ColumnFooters = true in the load statement (as)
(4) // c1TrueDBGrid/set the background color of a column
This. c1TrueDBGrid1. Splits [0]. DisplayColumns ["bb"]. Style. BackColor = System. Drawing. Color. Blue;
(5) // c1TrueDBGrid setting a column does not allow focus
This. c1TrueDBGrid1. Splits [0]. DisplayColumns ["bb"]. AllowFocus = false;
(6) // c1TrueDBGrid setting a column cannot be edited
This. c1TrueDBGrid1. Splits [0]. DisplayColumns ["bb"]. Locked = true;
(7) // set the width of a certain c1TrueDBGrid column to adaptive width.
This. c1TrueDBGrid1. Splits [0]. DisplayColumns ["aa"]. AutoSize ();
(8) // c1TrueDBGrid freezes a column
This. c1TrueDBGrid1. Splits [0]. DisplayColumns ["aa"]. Frozen = true;
Author: chinaboykai

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