This is a migrated thread and some comments may be shown as answers.

[Solved] Limiting number of lines shown

3 Answers 91 Views
Grid
This is a migrated thread and some comments may be shown as answers.
daniel coppee
Top achievements
Rank 1
daniel coppee asked on 28 Mar 2008, 05:16 PM
One of the fields I use in my grid contains a text (abstract).
In edit mode I want to view the whole text but in gridmode I only want to see 2 or 3 lines (just to see whether something is filled in or not).
How can I restrict the number of lines shown?

Thanks

Daniel

3 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 31 Mar 2008, 02:44 PM
Hello Daniel,

Although the functionality you requests is not supported out-of-the-box, you may consider enabling column resize and clipping the content of the cells with long text if applicable (specifying fixed width for the corresponding column):

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Client/Resizing/DefaultCS.aspx (resizing the columns in this demo to see the effect)

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
daniel coppee
Top achievements
Rank 1
answered on 31 Mar 2008, 02:59 PM
Hi Stephen,

If I use the fixed width, the height of the row becomes larger (as large as needed to include the whole text).

Is there a way to show a dummy field (a leftsting function of the large text).
In that case I could set the abstract-field not visible but editable and the dummy field read-only.

In fact, I'm looking for something similar sowing a total of two values. The values are stored in SQL, the total is not stored but it is prefered to be shown in the grid.

Regards,

Daniel
0
Sebastian
Telerik team
answered on 31 Mar 2008, 03:18 PM
Hi Daniel,

Thank you for the additional explanation. For this purpose consider intercepting the ItemDataBound event of RadGrid and cut the text for each grid item in the respective column when it is not in edit mode (inside e.Item is GridDataItem conditional check).

How to access cells and rows in RadGrid you can see from this online demo:

http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/Programming/AccessingCellsAndRows/DefaultCS.aspx

Best regards,
Stephen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
daniel coppee
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
daniel coppee
Top achievements
Rank 1
Share this question
or