EHLIB

xiaoxiao2021-03-06  152

EHLIB uses custom grid Title complex title TDBGRIDEH Allows you to create titles on multiple columns, set the dbgrideh.usemultititle property to TRUE and populate the title of the field, you can use the following rules: Field tab or column headings There must be several parts, and with "|" segmentation, each of several columns is set to the same. Other fields or titles must contain the same text in the corresponding portion.

For example: Field1.displayLabel: = 'title1 | subtitle1'; Field2.displayLabel: = 'Title1 | Subtitle2'; or dbgrideh.columns [0] .title.caption: = 'Title1 | Subtitle1'; dbgrideh.columns [1]. Title.caption: = 'Title1 | Subtitle2';

Press Title Set Column.title.titleButton to force the title unit to force the title unit. Write the OntitLebTnClick event to control the operation when the user clicks the title unit.

Display bitmap to show bitmap in Titles Instead of Caption Use TitleImnTitleEh is shown in Titles Instead of Caption Use TitleImages Property of TdbGrideh and ImageIndex Property.

Automatic positional identification sort headers. TDBGridEh allows to show special sortmarking bitmaps (small triangles) in the right part of title cell. In order to automatically marking title by sortmarking bitmaps add dghAutoSortMarking to OptionsEh property. Add dghMultiSortMarking too in order to allow sortmarking several columns simultaneously. Set Column.Title.TitleButton to true for titles which will have possibility to change sortmarkers at run time. At runtime clicking on title will change sortmarking. Holding Ctrl key allows to mark several columns simultaneously. After user change sormarking grid call OnSortMarkingChanged Event. You can write this event to change Sorting and reopen in dataset. Use sortmarkedcolumns property to access to sortmarked columns.

The default value of the title attribute uses TDBGRIDEH.COLUMNDEFVALUES.TITLE to set the default value of the title property.

Custom grid footer footer and statistics TDBGridEh allows to show special row (footer) or rows at bottom part. Use FooterRowCount property to specify the number of footer rows in the grid. Use Footer or Footers property of TColumnEh object to specify information which need to show in footer cells. Footers property useful then you have more then one footer rows. Footers is a collection of TColumnFooterEh objects where information from i-th aliment of collection will be show in i-th cell of footer column. in footer cell, it is possible to show:. Sum value for specified field, record count, value of a specified field or static text Use property Footer.ValueType or Footers [i] .ValueType to specify which type of value will be show in footer cell . If ValueType = fvtStaticText, then set the property value to specify text which need to show. If ValueType = fvtFieldValue, then you need to set property FieldName to specify field, value of which need to show. to force grid to calculate total values ​​need TO ACTIVATE SUMLIST (DBGridEh.SumList.Active: = True). Set ValueType to fvtSum and grid must to show sum value of the column field in the footer cell, you can also specify Column.Footer.FieldName to calculate total value of the other field Set. ValueType to fvtcount to force grid to show count of records in the footer cell.

The custom grid data unit displays the field value in the data unit as graphics. TDBGridEh allows to show bitmaps from TImageList component depending on field values ​​To show bitmaps depending on field values ​​need:. Fill list of field values ​​to Column.KeyList property (every value in separate line) and set Column.ImageList property to ImageList control that has the bitmap in according index. Set Column.NotInKeyListIndex to index of bitmap that will be shown if field's value does not correspond to any value in KeyList (for instance you can set index of image for Null field value). At run time you are not . allowed to edit bitmap in column cell Use blank key and mouse click to set next value from Column.KeyList to the field;. Shift-blank key and Shift-Mouse click to set previous value from Column.KeyList Set Column.DblClickNextval to True have allows to change value on mouse double click. check box logical and non-logical value Grid automatically shows checkboxes for boolean field. to show checkboxes for non boolean fields fill first line of Column.KeyList property that corresponds to the checked State of the Checkbox, Second Line - Non Checked State, And Set Column.checkboxes Ptoperty To True. Line of Keylist Can Represent More Than ONE VALUE IN A SEMICOLON-DELIMITED LIST OF ITEMS.

The data line is highly used by RowHeight and RowLines properties to specify high data lines. Complete data line high = line height travel height. Set RowsizingAllowed to True to allow you to use a mouse to change the row.

Setting Column.WordWrap to TRUE to make multiple lines of text in the data line. If you are high> text, it will wrap.

Display the Note field Set DrawMEMOTEXT To TRUE to display a textual note field. .

The font and color properties in the custom cell font and color TDBGRIDEH describe the fonts and colors of the cells drawn in the data grid. The Font and Color properties in TColumneh describe fonts and colors that draw cells in the specified column.

There are several events for event custom cell fonts and colors that allow you to customize cell fonts and colors before drawing cells. You can write TDBGRIDEH's OnDrawColumnCellevent event handle to draw data in the grid unit. You can use the canvaS property to draw cells. But if you just want to change the properties of the font or color, I suggest you use the following events. You can write TDBGRIDEH ONGETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCETCET to control the operations specified before drawing data units. You can change the drawing font and background colors. This event is suitable for you to use when you want to change the font or color of the whole line. If you want to change the properties of the cell in the specified column, you can use TColumneh.ongetcellparams. Write this event to control the operation when a column data unit is redrawn or edited. Before a column data unit is redrawn, you can change the drawing font, background color, alignment, image index, text, or check box. Before editing a column data unit, you can change the edit font, background color, text, or read state. The default value of the column properties uses the columnDefVALUES attribute to set the default value of the column properties. The newly created column will get attribute values ​​from the ColumnDefValues ​​property, and until the first time you specify.

Place the editor in the appropriate location of the grid. Several fields are displayed in the drop-down list. Several drop-down fields are displayed in the drop-down list, you need to set the column's lookupdisplayfields property to the semicolons property of the field to split multiple field names. The property named column.field.lookupResultfield must be in the LookUpDisplayFields list. Multi-field drop-down lists can only be applied to the drop-down field.

Show the drop-down column You can display other text in the relevant field via the keylist and picklist properties. Keylist displays the value contained in the field rather than the PickList index. Column.NotInKeyListIndex to index of text from PickList that will be shown if field value do not contain in KeyList (for instance you can set index of text for Null field value). Set Column.DblClickNextval to True to change value on mouse double click.

The drop-down calculator For the TDATEFIELD and TDATETIMEFIELD fields, the INPLACE editor displays the drop-down button to display the display drop-down calculator. Set column.ButtonStyle to CBSNE to disable the display drop-down button.

Setting the editor color and the font input editor can set the color and font of the data unit. The data unit uses the ONGETCELLPARAMS event to control the column color and font. The INPLACE editor is automatically set to multi-line mode when row> a row, and set the list of properties WordWrap to True.

Automatic Packing Net Gray Width to Grid Client Area Setting AutofitColWidths To set the width of the grid to the TRUE to set the width of the client. The MinautofitWidth property determines the minimum width of the grid and the column width will be recalculated.

3D or flat appearance Use the OptionseH property to display / hide fixed 3D framework, cold area, footer, and data lines. Use the FLAT attribute to set the data grid with a flat mode.

Import / export data from a variety of formats / export data to TDBGRIDEH EHLIB can export data from DBGRIDEH to Text, CSV, HTML, RTF, XLS, and its internal format. It saves data to stream (TSTREAM object) or file.

Examples Pascal: SaveDBGridEhToExportFile (TDBGridEhExportAsText, DBGridEh1, 'c: /temp/file1.txt',False); C : SaveDBGridEhToExportFile (__ classid (TDBGridEhExportAsText), DBGridEh1, "c: //temp//file1.txt", false); EHLIB's function set can be imported from Text and its internal format data into DBGRIDEH data set. It can read data from the file or read data to the stream (TSTREAM object).

Other features use the Lookup editor, you can empty (set to null) lookupkeyfield values ​​at runtime. For example, choose the entire text and press the DELETE button.

The cold zone refrigeration is the unconnected area displayed on the left side of the data grid column. Unlike the fixed column, the column of the cold zone can obtain editing focus. You can set the column set on the right by setting the Frozencols property.

Incremental Search TDBGRIDEH allows users to implement specific "increment" searches in the grid column. When the user enters incremental searches, he can display characters and grids, and look for text in the current column. Use DGHINCSEARCH and DGHPREFERINCSEARCH (in the Optionseh option) Operate the search in the data grid. The DGHINCSEARCH value allows incremental searches in the data grid. When you run, you can use the following to perform incremental search: Ctrl f - Start incremental search. Ctrl Enter - Find the next match record. Ctrl Shift ENTER - Find the previous match record.

If the dghincsearch in the optionSeh option is read-only, the network will automatically set the increment mode to return to normal mode after the first button and 1.5 seconds. DGHPREFERINCSEARCH Value Decision Grid Setting Auto Increment Search Mode Alternate unit editing during the first button.

Horizontal or vertical scroll bars use VertsctollBar, HorzsctollBar properties to display / hide and track horizontal or vertical scroll bars.

Multiple TDBGRIDEH allows you to select a record, column, and rectangular areas such as selection, column, and rectangular areas: allowing multiple options to affect the following properties: The DGMultiSelect property in the Options option - Set whether you allow multiple choices. The DghcleRSerection property in the Options option - setting whether the selected record is cleared when the user moves to the next unit. The EditActions Properties in the Options option - Settings Users can perform which operations can be performed on the selected record (such as copy, cut, delete, paste, all choice, etc.). AllowedSelections properties in the Options option - Set the type (such as line, column, rectangular area, etc.) that allow the selected record. Selection attribute in the Options option - Sets a current multi-select state, selected record, column, or rectangular area, and attributes and functions to access them.

Save or recover the hierarchical TDBGrideh of the grid and columns from the registry or INI file with a registry or in the registry or INI file, and the hierarchy of the column: RESTORECOLUMNSLAYOUT - Restore the order, width of the column from the registry Sort flag. RestoreColumnsLayoutini - The order, width, and sort flag of recovered columns from the INI file. RESTOREGRIDLAYOUT - The order, width, visual, sort flag, sorting index, or rising high from the registry. RESTOREGRIDLAYOUTINI - The order, width, visual, sort flag, sort index, or rising high from the INI file. SAVECOLUMNSLAYOUT - Save the order, width, and sort flag to the registry. SaveColumnsLayoutini - Save the order, width, and sort flag to the INI file. SaveGridLayout - Save the order, width, visual, sort flag, sort index, or row to the registry. SaveGridLayoutini - Save the order, width, visual, sort flag, sort index or row to the INI file. The current version of TDBGRIDEH is not supported: TDBGRIDEH cannot set high rows of lines in each data window. TDBGRIDEH cannot work as TreeView. It cannot have nodes and branches. TDBGRIDEH does not merge the data unit laterally or vertically.

Convert existing TDBGRID components to TDBGRIDEH components:

Although TDBGRIDEH is not inherited from the TCUSTOMDBGRID component, there is still some similar properties in TDBGRIDEH and TDBGRID. It allows only a little cost to convert existing TDBGRID components to TDBGRIDEH. The existing TDBGRID components can be converted to TDBGRIDEH in accordance with the prompts below: Open the application containing TDBGRID components in the Delphi IDE.

Set the view mode as a text method (ALT-F12). if key = VK_RETURN then // Key: Enter beginif (grdDetailData.SelectedIndex = grdDetailData.Columns.Count-1) and not (dgRowSelect in grdDetailData.Options) thenBEGINif (dgEditing in grdDetailData.Options) and (grdDetailData.Row = grdDetailData. RowCount-1) THEN / / Can be edited from table Grid and current cursor focus in the last row acadddetailexecute (self) elsebeggingrddetaildata.row: = GrddetAildata.row 1; // change the cursor focus line to the next line (when adding when the sentence without running grdDetailData.SelectedIndex: = 0 // change the cursor focus column to the first column end; END ELSEBEGINgrdDetailData.SelectedIndex: = grdDetailData.SelectedIndex 1; while grdDetailData.Columns [grdDetailData.SelectedIndex] .ReadOnly dogrdDetailData.SelectedIndex : = GrddetAildata.selectedIndex 1; End; Key: = 0; End; if key = vk_insert the // INSERT button: Add a record beginacadddailexecute (self); key: = 0; end; if key = vk_delete kil Delte: Delete a record of beginacdeledetailexecute (self); key: = 0; end; page footgiometer 1, set the FOOTERROWCOUNT value of the dbgrideh property is 1; 2, set the sumlist of the dbgrideh property to true; The column of Footer's valueetype type is fvtsum; 4, run OK! Write when Dataset is opened: dbgrideh1.columns [0] .footer.Value: = INTOSTR (dbgrideh1.datasource.datase T.RecordCount;

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

New Post(0)