Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.10.31;
Скачать: CL | DM;

Вниз

Как убрать из ячеек 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;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.01 c
14-101529
Mr_Random
2002-10-14 02:25
2002.10.31
C++ Builder


14-101468
VictorT
2002-10-09 17:08
2002.10.31
Про null в базах


1-101374
3asys
2002-10-21 12:04
2002.10.31
Моделирование design-time в run-time


3-101062
Velzevul
2002-10-12 16:23
2002.10.31
Использование компонента Table в цикле


3-101085
Vlad2
2002-10-14 11:59
2002.10.31
Использование mssql.TempDb