1, xtratreelist the text in the cell is too long, how to implement line wrapping
answer : Set Treelistoptionsbehavior.autonodeheight to True to make cell wrapping possible by setting the editor of the column to Memoedit.
2. Xtratreelist slow when setting the Column property
Description: I'm using C #, and I'm having a little problem with the devexpress.xtratreelist control. When I set properties to Treelist's column, the program runs very slowly. I traverse each column of Treelist, the column caption is set to Chinese, the results of the first row, the more slowly later, even only 42 columns, the results of up to 20 minutes have not been executed, how to solve AH.
answer : On the left side of Treelist, set this property to Fixedstyle.left. Set this property to Fixedstyle.right on the right side of the treelist, and the fixed column is separated by a vertical line (the width set by the treelist).
3, how to adjust the dxperience xtratreelist text size and font
Description: How to adjust the size and font of the text in the Xtratreelist, the font in the attribute is no use.
answer : If you are modifying the font format in the data line, set it with the font in the row property under appearance in the attribute, and if it is the font format of the header, it is set with the font in the header property under appearance in the property.
4. How to hide the focus frame of xtratreelist selected cell
answer : To hide the focus frame of a xtratreelist selected cell, set the treelist. The Optionsview.showfocusedframe property is set to False.
5. Xtratreelist can expand and close nodes by keyboard
answer : You can use the keyboard to expand and close the nodes, use "Ctrl" + "→"; close the nodes, using "Ctrl" + "←".
6. Xtratreelist How to hide the front row indication column
answer : To hide the front row indicates the column, set the Treelistoptionview.showindicator property to False.
7, how to get the row of the current node through the node nodes of DXperience treelist
answer : Add the following code
| 1 2 |
System.Data.DataRowView ROV = Treelist1.getdatarecordbynode (node) as System.Data.DataRowView; |
8. How to navigate dxperience treelist tree control
Answer : Please refer to the following code
| 1 2 3 4 5 6 7 8 9 10 11 12 |
Create the Group control container Navbargroupcontrolcontainer Groupcontainer = new Navbargroupcontrolcontainer (); Navbargroup Group = new Navbargroup ("GroupName"); Group. Smallimage = new Icon ("Youricon.ico"); Group. GroupStyle = Navbargroupstyle.controlcontainer; M_NAVBAR.CONTROLS.ADD (Groupcontainer); Group. Controlcontainer = Groupcontainer; Group. Visible = true; Customcontrol.dock = DockStyle.Fill; GROUPCONTAINER.CONTROLS.ADD (CustomControl); |
9, DXperience treelist How to implement the partially selected check box
Answer : Please refer to the following example:
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
void Selectspecificnode () {ArrayList selectednodes = new ArrayList (); Selectchildren (Treelist1.nodes[0]. Nodes[0], selectednodes); TreeList1.Selection.Set (Selectednodes); } void Selectchildren (treelistnode parent, ArrayList selectednodes) {IEnumerator en = parent. Nodes.getenumerator (); Treelistnode child; while (en. MoveNext ()) {child = (treelistnode) en. Current; Selectednodes.add (child); if (child. HasChildren) Selectchildren (Child, selectednodes); } } |
10. How to highlight each node of DXperience treelist tree control
answer : Refer to the following code
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
private void Treelist1_customdrawnodecell (object sender, DevExpress.XtraTreeList.CustomDrawNodeCellEventArgs e) { treelist node = sender as Treelist; if (E.node = = Node. Focusednode) { E.graphics.fillrectangle (Systembrushes.window, e.bounds); Rectangle r = new Rectangle (E.editviewinfo.contentrect.left, E.editviewinfo.contentrect.top, Convert Treelist1.font). Width + 1), Convert.ToInt32 (e.graphics.measurestring (E.celltext,treelist1.font). Height)); E.graphics.fillrectangle (Systembrushes.highlight, R);                   e.graphics.drawstring (E.celltext, Treelist1.font, Systembrushes.highlighttext, R); e.handled = true; } } |
Extended reading:
Summary of how to use xtratreelist tree controls