Jump to content

[Solved ]UniStringGrid Editor/View


Gabriel

Recommended Posts

Hi, 

I have an issue with the UniStringGrid. The problem is with the visualization and the edition of the information. The visualization is like html, but the edition es plain text. Is there a way to work always with plain text?

This is how the information is viewed:

blob.png.8a74dd5bd4d1fbd5b1a5c847d915d9a0.png

If I edit the field 

blob.png.ed94608e834536498782bc4521f1a2f3.png

There is a lot of white space (that is correct). 

The only way to replicate the white space is adding  , but of course that the end user will not use that. So, basically what i am asking is if there is a way to change the view of the UniStringGrid to show the white spaces.

 

Regards

 

 

 

Edited by gmarazzi
It whas solved!
Link to comment
Share on other sites

  • 2 weeks later...

Hi.

Sure!. I attach the sample aplication. As you will see there is a small UniStringGrid in the project

 

blob.png.9ad695f341d3899de5ab0ac73b2de1fc.png

 

On the creation event, i set the values:

 

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  UniStringGrid1.Cells[0,1] := 'This Cell has no spaces';
  UniStringGrid1.Cells[0,2] := 'This                          Cell                           has                   a                         lot                          of                           spaces';
end;

 

As i said, i didnt find a way to show the spaces on the cell (0,2).

 

But if you edit the cell the spaces are shown correctly.

 

 

Let me know if you need anything else.

The same issue happen if i edit the fields manually.

Regards

 

 

blob.png

UniStringGrid.zip

Link to comment
Share on other sites

1 minute ago, Sherzod said:

Ok,

You can try to use this approach:

1. ServerModule -> CustomCSS:


.customSG .x-grid-cell-inner {
    white-space: pre;
}

2. In designtime for example:


UniStringGrid1 -> LayoutConfig -> Cls = customSG

 

Sorry and thank you for the testcase

Please check above solution

  • Upvote 1
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...