View Issue Details

IDProjectCategoryView StatusLast Update
0001428JEDI VCL00 JVCL Componentspublic2004-04-22 02:56
ReporterxerkanAssigned Touser72 
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0001428: Error in ShowColumnsDialog of tjvdbgrid
DescriptionIf in "columns editor" of a dbgrid there are not selected all the fields of which it consists, on having called to the procedure this ShowColumnsDialog, the data base shows an error of the type list index out of bounds.

Also I would like that the fields, it was showing them in the order that they appear in the dbgrid instead of in the order in which they are in the table
Additional InformationSi en el "columns editor" de un dbgrid no se seleccionan todos los campos del los que consta la base de datos al llamar al procedimiento ShowColumnsDialog este muestra un error del tipo list index out of bounds.

Tambien me gustaria que los campos, los mostrara en el orden que aparecen en el dbgrid en vez de en el orden en el que estan en el la tabla
TagsNo tags attached.

Activities

user72

2004-03-05 02:03

  ~0003217

Remove the List Index out of bounds (in JvDBGridSelectColumnForm, changes in bold):

procedure TfrmSelectColumn.FormActivate(Sender: TObject);
var
  i, j: Integer;
  lColumn: TColumn;
begin
  if Assigned(FJvDBGrid) then
    with FJvDBGrid do
    begin
      clbList.Items.Clear;
      if (FSelectColumn = scDatabase) and Assigned(DataSource) and Assigned(DataSource.Dataset) then
      begin
        with DataSource.Dataset do
          for i := 0 to FieldCount - 1 do
          begin
            lColumn := GetColumn(Fields[i]);
            if Assigned(lColumn) then
            begin
               j := clbList.Items.AddObject(Fields[i].DisplayLabel, TObject(lColumn.Index));
              clbList.Checked[j] := lColumn.Visible and Fields[i].Visible;
            end;
          end;
      end
      else
      begin
        for i := 0 to Columns.Count - 1 do
        begin
          j := clbList.Items.AddObject(FJvDBGrid.Columns[i].FieldName, TObject(i));
          clbList.Checked[j] := FJvDBGrid.Columns[i].Visible;
        end;
      end;
      if clbList.Items.Count > 0 then
        clbList.ItemIndex := 0;
    end;
  ResizeForm;
end;

To show items in grid order, change SelectColumn to scGrid

user72

2004-03-07 13:53

  ~0003253

Fixed in CVS

Issue History

Date Modified Username Field Change
2004-03-05 00:40 xerkan New Issue
2004-03-05 02:03 user72 Note Added: 0003217
2004-03-05 02:05 user72 Status new => assigned
2004-03-05 02:05 user72 Assigned To => user72
2004-03-07 13:53 user72 Status assigned => resolved
2004-03-07 13:53 user72 Resolution open => fixed
2004-03-07 13:53 user72 Note Added: 0003253
2004-04-22 02:56 user72 Status resolved => closed