View Issue Details

IDProjectCategoryView StatusLast Update
0001325JEDI VCL00 JVCL Componentspublic2004-03-09 02:44
ReporterxerkanAssigned Touser72 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001325: add property TypeSortMarker in the TJvDBGrid
DescriptionHe 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 InformationMe 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
TagsNo tags attached.

Activities

user72

2004-02-13 14:04

  ~0002933

You can use the OnGetBtnParams event do define the sortmarker to use

xerkan

2004-02-13 16:08

reporter   ~0002943

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.

user72

2004-02-14 03:34

  ~0002947

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;

xerkan

2004-02-15 23:50

reporter   ~0002950

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;

user72

2004-02-17 09:59

  ~0002966

Last edited: 2004-02-17 12:23

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

user72

2004-02-26 13:08

  ~0003090

This (and several other sort updates) have been added to CVS

Issue History

Date Modified Username Field Change
2004-02-12 23:25 xerkan New Issue
2004-02-13 14:04 user72 Note Added: 0002933
2004-02-13 16:08 xerkan Note Added: 0002943
2004-02-14 03:34 user72 Note Added: 0002947
2004-02-14 03:35 user72 Status new => assigned
2004-02-14 03:35 user72 Assigned To => user72
2004-02-15 23:50 xerkan Note Added: 0002950
2004-02-17 09:59 user72 Note Added: 0002966
2004-02-17 12:23 user72 Note Edited: 0002966
2004-02-26 13:08 user72 Status assigned => resolved
2004-02-26 13:08 user72 Resolution open => fixed
2004-02-26 13:08 user72 Note Added: 0003090
2004-03-09 02:44 user72 Status resolved => closed