Common functions of ultragrid

Source: Internet
Author: User

Ultragrid is a very powerful third-party Windows application component, which belongs to the infragistics software of netadvantage.

Databinding is the same as DataGrid. You can set datasource.

It is convenient to drag the ultragrid to the designer and adjust it through propertygrid.

(1) different values can be given different colors.
Properties-> displaylayout-> bands-> 0-xxx-> Columns-> in the pop-up window, select a column-> valuebaseappearance-> Add conditions.

(2) give each line a description
In the event response of initializerow, write e. Row. Description = "my description. You need to set this. ultrated1.displaylayout. Bands [0]. autopreviewenabled = true;

(3) gradient of a line
Ultraman Drow objrow = This. Ultraman d1.rows [10];
This. ultrated1.activerow = objrow;
This. ultrated1.rows [10]. Appearance. backcolor2 = color. blue;
This. ultrated1.rows [10]. Appearance. backgradientstyle = gradientstyle. circular;

(4) change the format setting at runtime
This. ultrated1.applypresetfromxml (file name, true)

(5) set the width of each column
Foreach (ultratedcolumn column in E. layout. Bands [0]. columns)
{
Column. width = 100;
}

(6) generate and use appearance

This. ultrated1.displaylayout. Appearances. Add ("highlighted ");
This. ultrated1.displaylayout. Appearances ["highlighted"]. backcolor = color. Red;
This. ultrated1.displaylayout. Appearances ["highlighted"]. backcolor = color. White;
Or assign a value to the preset appearance.
This. ultrated1.displaylayout. Override. activerowappearance. forecolor = color. White;

(7) Use dropdown list
In properties-> displaylayout-> valuelists, add ValueList
Properties-> displaylayout-> bands-> 0-xxx-> Columns-> A column-> ValueList is equal to the newly added ValueList, and the style is set to dropdown.

The header in the grid does not move to the top
Set stationarymargins in displaylayout

Set Data Filtering in Grid
// The browser, loadondemand, and viewtype settings to enable XMLHttp Support were done at design time. // setting of these setting can be done at design time but are done here to show them being set explictly.

// Turn on Filtering
Layout. filteroptionsdefault. allowrowfiltering = infragistics. webui. ultrawebgrid. rowfiltering. onserver;

// Limit the size of the dropdown
Layout. filteroptionsdefault. dropdownrowcount = 10;
Layout. filteroptionsdefault. filterdropdownstyle. width = unit. pixel (190)

// Turn on rowisland Filtering
// Rowisland filtering only filters the siblings rows of a group. For Band zero, all band zero rows are siblings so there
// Is little difference in the modes, however in child bands, this behavior is more evident.
Layout. filteroptionsdefault. rowfiltermode = infragistics. webui. ultrawebgrid. rowfiltermode. siblingrowsonly;

 

In grid filterpopulating
// Get the unique country names
E. workinglist. addrange (arraylist );
// Tell the webgrid not to go looking for the data. By setting this
// Flag to true, the webgrid uses the provided list for it's data.
E. Handled = true;

The grid data source must be set in initializedatasource.
The grid must be bound to a fixed able and cannot be dynamically new
Set isbound = true for each row.

 

Grid automatically reads data using Ajax
Set browser to XML, loadondemand to XML, and viewtype to hierarchical. However, you must bind data to initializedatasource.

Get the top column in the grid
Layout. Bands [0]. Columns. fromkey ("key ")

Pagination in Grid
Set pagination allowed in pager. Page size
Bind data in initializedatasource

Custom pagination needs to be set
Layout. Pager. stylemode = infragistics. webui. ultrawebgrid. pagerstylemode. customlabels;
Set pattern to <Table width = 100%> <tr> <TD align = left> page number: [currentpageindex]/[pagecount] per page: [pagesize] </TD> <TD align = right> [Default] <TD> </tr> </table>

Layout. Pager. customlabels = letters;
Allowcustompaging in page and set the data to be displayed in pageindexchanged
For example, set the data source to mermertable2 and set it in pageindexchanged:
Customertable2.defaultview. rowfilter = "customerid like '" + letters [E. NewPageIndex-1] + "% '";

Letters:
Letters = new string [lettercount];
For (INT I = 0; I <lettercount; I ++)
Letters [I] = (char) (INT) 'A' + I). tostring ();

Infragistics. Win. ultrawingrid. excelexport. ultratedexcelexporter and control infragistics. Win. ultrawingrid. ultragrid
And control system. Windows. Forms. savefiledialog
Used to import data into an Excel table

When ultragrid is bound with data
Dim strfilepath as string
With savefiledialog
. Filter = "Excel (*. xls) | *. xls"
. Restoredirectory = true
Strfilepath =. filename
If. showdialog = dialogresult. OK then
Ultraman dexcelexporter. Export (ultragrid, strfilepath)
End if
End

Common attributes of diagramwinformscontrol in corgent. diagramming. winformscontrol. diagramwinformscontrol
Diagramwinformcontrol. pagealignment (page arrangement)
Diagramwinformcontrol. showgrid = true/false whether to display grid lines
Diagramwinformcontrol. showguides = true/false is the display guide navigation
Diagramwinformcontrol. showpagenavigator = true/false whether to display page navigation
Diagramwinformcontrol. showrulers = true/false whether to display the ruler
Diagramwinformcontrol. showzoomtracker = true/false show zoom navigation
Diagramwinformcontrol. zoomtofit = true/false whether to automatically scale to the appropriate proportion

Common Properties of listview in system. Windows. Forms. listview
Listview. view = Details is displayed in detail
Listview. fullrowselect = true/false whether the entire row can be selected
Listview. gridlines = true/false show grid lines
Listview. Columns. Add (column name, column width, alignment) add column header
Listview. selecteditems. count the number of selected rows
Listview. Items (INDEX). subitems. Add adds information to a column (item) in a row

When the devexpress. xtragrid. gridcontrol control involves rebinding, if it is bound to a table with different data structures, the default view of the control should be cleared first.
Gridcontrol. datasource = nothing
Gridview1.columns. Clear

Common attributes of navbargroup in devexpress. xtranavbar. navbargroup
Navbargroup. groupstyle = controlcontainer you can add other controls to the control.

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.