(1)

Source: Internet
Author: User

XtraGrid has powerful functions, such as filtering, sorting, Master/Slave tables, and group. Here we only write some usage experiences in the practice process. You can find many usage methods in its own sample.

1.How to display the horizontal scroll bar is not displayed by default. I have been searching for this for a long time.

Set OptionsView. ColumnAutoWidth = false;

2.Display custom text in cells, such as bandingThe value is 1., You want to display one

CustomColumnDisplayText event setting e. DisplayText = "XXX"

3.Set the color of a row

Set e. Appearance. BackColor in the RowStyle event

4.Set the color of a cell

Set e. Appearance. BackColor in the RowCellStyle event

5.Show filter row,Filter rows.

OptionsView. ShowAutoFilterRow = true;

6.A full button is displayed in the cell of a column.

Select ColumnEdit new and ButtonEdit in that column, and set ButtonEdit. Buttons [0]. Caption = "XXX ",

Set ButtonEdit. Buttons [0]. Kind = Glyph. Otherwise, the button is not supported by the cell. (The default Kind is Ellipsis)

Implement the ButtonClick event of ButtonEdit.

7.Set the Master/Slave table.SourceIs dataset,The master-slave table relationship is set in the table, which is supported by default,Resolve binding hereTo adoenitity(Or other entities), the entity set entity is also the relationship between the master and slave tables..

In the MasterRowGetRelationCount event, set e. relationCount = 1; (if two slave tables write 2, and so on), then set e in the MasterRowGetChildList event. childList = a record in the master table corresponds to n records in the slave table. e. childList accepts an IList. e has three parameter rowHandle numbers, the number of the master-slave relationship in relationIndex, and childList sets the value of the record in the row corresponding to the master table in the slave table.

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.