View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001325 | JEDI VCL | 00 JVCL Components | public | 2004-02-12 23:25 | 2004-03-09 02:44 |
| Reporter | xerkan | Assigned To | user72 | ||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | closed | Resolution | fixed | ||
| Product Version | |||||
| Target Version | Fixed in Version | ||||
| Summary | 0001325: add property TypeSortMarker in the TJvDBGrid | ||||
| Description | He would ask me if it is possible to add a property to the tjvdgrid to define the type of arrow (smNone, smDown, smUp) associated with the property SortedField it will appear in the grid, also it might put another property in order that instead of choosing one of the arrows for shortcoming it was possible to define one by means of an image | ||||
| Additional Information | Me preguntaria si es posible añadir una propiedad al tjvdgrid para definir el tipo de flecha (smNone, smDown, smUp) asociada a la propiedad SortedField se mostrara en el grid, tambien se podria poner otra propiedad para que en vez de elegir una de las flechas por defecto se pudiera definir una mediante una imagen | ||||
| Tags | No tags attached. | ||||
|
|
You can use the OnGetBtnParams event do define the sortmarker to use |
|
|
If I have tried it earlier and put the following code in the event OnGetBtnParams: procedure TfrmBancos.dbgDatosGetBtnParams(Sender: TObject; Field: TField; AFont: TFont; var Background: TColor; var SortMarker: TSortMarker; IsDown: Boolean); begin SortMarker:=smUp; end; and the name in of one of the fields in the property sortedfield, but the arrow me her to position in all the columns of the grid instead of making her alone in the one that was indicating him sortedField. |
|
|
Here's a very simple example using a BDE TTable:
procedure TForm1.JvDBGrid1GetBtnParams(Sender: TObject; Field: TField;
AFont: TFont; var Background: TColor; var SortMarker: TSortMarker;
IsDown: Boolean);
var ID:TIndexDef;
begin
ID := nil;
if IsDown or (JvDBGrid1.SortedField = Field.FieldName) then
begin
ID := Table1.IndexDefs.GetIndexForFields(Field.FieldName, false);
if (JvDBGrid1.SortedField <> Field.FieldName) and (ID <> nil) then
begin
Table1.IndexName := ID.Name;
JvDBGrid1.SortedField := Field.FieldName;
end;
end;
if ID <> nil then
SortMarker := smDown
else
SortMarker := smNone;
end;
|
|
|
thanks view your example, i'm make this code: if IsDown or (dbgDatos.SortedField = Field.FieldName) then begin SortMarker:=smUp; if dbgDatos.SortedField <> Field.FieldName then begin OrderTable(Field.FieldName); dbgDatos.SortedField:=Field.FieldName; end; end else SortMarker := smNone; |
|
|
FYI, I am looking into this issue at the moment possibly resulting in a new SortMarker property and probably an AutoSort:boolean property as well. There won't be any changes to JvDBGrid before the JVCL3 release but as soon as code freeze is lifted I will commit a new version. edited on: 02-17-04 12:23 |
|
|
This (and several other sort updates) have been added to CVS |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2004-02-12 23:25 | xerkan | New Issue | |
| 2004-02-13 14:04 |
|
Note Added: 0002933 | |
| 2004-02-13 16:08 | xerkan | Note Added: 0002943 | |
| 2004-02-14 03:34 |
|
Note Added: 0002947 | |
| 2004-02-14 03:35 |
|
Status | new => assigned |
| 2004-02-14 03:35 |
|
Assigned To | => user72 |
| 2004-02-15 23:50 | xerkan | Note Added: 0002950 | |
| 2004-02-17 09:59 |
|
Note Added: 0002966 | |
| 2004-02-17 12:23 |
|
Note Edited: 0002966 | |
| 2004-02-26 13:08 |
|
Status | assigned => resolved |
| 2004-02-26 13:08 |
|
Resolution | open => fixed |
| 2004-02-26 13:08 |
|
Note Added: 0003090 | |
| 2004-03-09 02:44 |
|
Status | resolved => closed |