Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Базы";
Текущий архив: 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
1-101298
ximka
2002-10-17 21:14
2002.10.31
Математическое моделирование


3-101152
Sergey-ZZZ
2002-10-10 12:21
2002.10.31
Преобразование типов данных MSSQL


1-101272
shubin
2002-10-22 10:01
2002.10.31
День добрый!


8-101391
Юра
2002-07-04 00:02
2002.10.31
SoundCard


3-101132
Romul
2002-10-10 11:05
2002.10.31
Формат даты в Access





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский