- Xtrareport
- Paper direction change: Landscape = true/false
- Default paper output: paperkind = A4
- Variation: margins = 100,100,100,100
- Page number display: Select xrpageinfo in dx.9.3 report control in the toolbar. You can design the corresponding format using the format in the control attribute, for example, page {0} of {1}
- Page display line control: Call xrpagebreak control, Detailed Help: http://documentation.devexpress.com/#XtraReports/CustomDocument5283
([Datasource. currentrowindex] % [parameters. parameter1] = 0) and ([datasource. currentrowindex]! = 0)
- Passing parameters from a form to a report: Same as passing parameters between forms
- When the report format is one paper but one page does not support multiple tables, or the same header or logo is required, you can use the inheritance table method for page design.
- The same type of table data sources can also be designed in the inheritance mode, and various computing methods can be managed in a unified manner in the parent table, without the need to process in each table, increasing maintainability.
2. xtragrid
No xtragrid is available, but similar functions may be implemented through control events:
Code:
Private void gridviewmain_showingeditor (Object sender, system. componentmodel. canceleventargs E)
{
Gridview view = sender as gridview;
If (convert. tostring (view. getrowcellvalue (view. focusedrowhandle, collock_if) = "yes ")
{
E. Cancel = true;
}
}
Problem: the grid requires a full selection function, but after code implementation, it is found that the last one is always unavailable.
Solution: the final data can be submitted using the posteditor () method.
Problem: The data is edited in the front-end grid, but the data of the last control that obtains the focus is lost when it is saved.
Solution: implement the posteditor () method when saving data, and implement the following method in the cellvaluechanged event (note that it varies depending on the name of the gridview)
Gridviewmain. closeeditor ();
Gridviewmain. updatecurrentrow ();
3. xtrabar
1. xtrabaredititem
Problem: Add lookupedit to the toolbar and use the code to automatically select a project in lookupedit.
Solution: Assume that gridlkdept has been bound to the data source, and the displaymember data in the data source contains text data such as "test ".
Lkitem: devexpress. xtrabars. baredititem
Gridlkdept: lookupedit (built in lkitem)
Implementation Code: lkitem. editvalue = gridlkdept. getkeyvaluebydisplaytext ("test ");