Форум: "Базы";
Текущий архив: 2002.10.31;
Скачать: [xml.tar.bz2];
Вниз
Как убрать из ячеек DBGrid-а ,букву Найти похожие ветки
← →
dimonf (2002-10-09 18:51) [0]Я заполняю DBGrid из Table. У меня в Table есть денежное поле. Оно вставляеться в DBGrid с буквой "р" - рубли. Как мне ее поменять на любую другую букву? Например на "у.е.".
← →
Mike Kouzmine (2002-10-09 18:59) [1]Региональные настройки или, если возможно, displayformat у tfield
← →
MsGuns (2002-10-09 19:03) [2]Обрабатывать OnGetText, где выкидывать "р" и все, что дальше следует
← →
dimonf (2002-10-09 19:37) [3]MsGuns напиши как это делаеться, а то у меня ума не хватает. %)
← →
MsGuns (2002-10-09 21:33) [4]>dimonf © (09.10.02 19:37)
>MsGuns напиши как это делаеться, а то у меня ума не хватает. %)
Occurs when the DisplayText or Text properties of the field are referenced.
type TFieldGetTextEvent = procedure(Sender: TField; var Text: String; DisplayText: Boolean) of object;
property OnGetText: TFieldGetTextEvent;
Description
Write an OnGetText handler to perform custom processing for the DisplayText and Text properties. Use OnGetText to format the Value of the field differently when it must be edited from the format used when simply displaying the value, or use OnGetText to display something other than the field’s value when it is displayed.
The Sender parameter is the field component. The Text parameter returns the formatted text that is used by the DisplayText or Text property. The DisplayText parameter indicates whether the text will be used for display purposes only, or whether the string will be used for editing.
If there is no OnGetText handler, the value of the DisplayText and Text properties is simply the value of the AsString property.
Это событие класса TField
Сажаешь на соотв.поле своего НД этот обработчик (его, ессно, надо написать) и в гриде (или в другом контроле, связанным с этим полем) будет возникать тот Text, который будет получаться в рез-те работы этого обработчика. Т.е. можно в принципе не только убрать букву или вообще что бы то ни было, но и полностью перековеркать содержимое поля. Например, вместо числа выводить "две тысячи шестьсот гривнябаксов"
← →
Val (2002-10-09 21:45) [5]в данном случае, все же проще поставить соответсвующий DisplayFormat(например 0.00) у поля, как говорилось выше.
Страницы: 1 вся ветка
Форум: "Базы";
Текущий архив: 2002.10.31;
Скачать: [xml.tar.bz2];
Память: 0.45 MB
Время: 0.009 c