alexsob
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору snike555 В пятой версии в DBGridEh.pas процедура TColumnEh.SetCheckboxState: если поле числовое, то независимо от значений в KeyList для чекбоксов проставляются 1 или 0. Мой вариант процедуры: procedure TColumnEh.SetCheckboxState(const Value: TCheckBoxState); var S: String; Pos: Integer; begin if not Assigned(Field) then Exit; if Value = cbGrayed then //Field.Clear UpdateDataValues('', Null, False) else if (Field.DataType = ftBoolean) then if Value = cbChecked then UpdateDataValues('', True, False) else UpdateDataValues('', False, False) else if (Field.DataType in [ftInteger, ftSmallint, ftFloat, ftBCD, ftCurrency {$IFDEF EH_LIB_6}, ftFMTBcd{$ENDIF} ]) and (KeyList.Count=0) { так будет интереснее } then if Value = cbChecked then UpdateDataValues('', 1, False) else UpdateDataValues('', 0, False) else begin if Value = cbChecked then if KeyList.Count > 0 then S := KeyList[0] else S := '' else if KeyList.Count > 1 then S := KeyList[1] else S := ''; Pos := 1; //Field.Text := ExtractFieldName(S, Pos); S := ExtractFieldName(S, Pos); UpdateDataValues(S, S, True); end; end; |