Sort

xiaoxiao2021-04-07  342

The following code is added to itemcreated

If (E.Item.itemType == ListItemType.Header) {string strsortby = (string) ViewState ["sortexpression"]; // Sort column string string string string string stringState ["sortascending"]; // is ascended Or String Strorder = (strsORTASCENDING == "YES"? "5": "6"); // Set ascending or descending display symbol

For (int i = 0; datagrid1.columns.count; i ) {if (strolormns [i] .sortexpression; {TableCell Cell = E.Item.cells [i]; label lblsorted = new label ); Lblsorted.font.name = "Webdings"; lblsort.fon.size = fontunit.xsmall; lblsort.text = Strorder; cell.controls.add (lblsorted);}}}

The column to be identified is the column that its sortexpression matches the current sort expression. After found this column, create a new tag control, set its font to WebDings, select font size and text (usually the 5th and 6th I recently added the label to the cell loaded with column village.

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

New Post(0)