Restrict length of content of a memo or text field in a grid column? - Forum

Forum Navigation
You need to log in to create posts and topics.

Restrict length of content of a memo or text field in a grid column?

Is there a way to restrict the length of content of a memo or text field in a grid column?

I know how to set the column width & row height in the grid. I'm wondering if there's a way to show just, say the first 100 characters of a field?

It's not a huge deal if it can't be done.

if you are using dbpExecSQL you could try something like this:

select SUBSTRING(yourcolumnname,0,100) from yourtablename

This can depend on the database server you are using, if that didn't work you could try something like:

SELECT SUBSTRING(CustomerName, 1, 100) AS ExtractString
FROM Customers;

Check this out for more detailed information. But it can be done with some tricky coding I believe...

https://www.w3schools.com/sql/func_sqlserver_substring.asp

You may be able to run this on an existing query. I have not tested it myself. I hope this points you in a productive direction.

vwatson has reacted to this post.
vwatson

Okay, I was just using the basic neodbpro commands. I'll look into the sql to see if it's worth doing.

Currently the grid shows the entire content in a tooltip for the selected row, so maybe I should just leave it as is.