Solution abnormality display field displays the DBGridEh paragraph text type

The last encounter in the system to the customer to make a difficult issue, when billing, each product has a "product description" this field, I will naturally use DBGridEh table, one per line of products, but I found a long description of the product even a few paragraphs, then DBGridEh of RowHeight 0 is automatic if no problem, but when customers say the line is too narrow to end up a bit, then the corresponding column of text which appears a few lines of text, and quickly EndEllips this field is set to True, WordWrap is set to False, die, which under the embarrassing, the line of customers do not want to tune narrow, raised the bar this text will come out a few lines cover each other up and down quite ugly , you can try.

Conditions of the problem

DBGridEh properties: RowHeight = 25,

Column attributes: EndEllips = True, WordWrap = False

In this column when you enter a few lines of text back to the car, you'll find the problem

Solution:

The data source is TADOQuery, first of all Field import, select the "product description" in this field, write OnGetText event

procedure TForm_IQOrder1.QueryBill1HotelNameGetText(Sender: TField;
  var Text: String; DisplayText: Boolean);
begin
  inherited;
  Text:=StringReplace(Sender.AsString,#13,'',[rfReplaceAll]);
end;

Word processing principle is to be displayed in this field, the field Enter the inner tube into an empty field and then show that the problem is solved, the only event processing and display text field is not influenced by the actual content, so no matter how long the text (field allowable range ah), there are a few paragraphs, he would show only one line within.

 

Guess you like

Origin blog.csdn.net/victor_yang/article/details/88864791