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

Suggestion: single-line row with maximum column width

8 Answers 190 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 2
Rob asked on 11 Jul 2008, 02:50 PM
Hi there,

playing with the rad grid yesterday, it occurred to me that a useful bit of functionality would be to have the text outputted on each row to be formatted with the maximum amount of text available in its column width plus elipses (...).

This would mean column widths can be set and they wouldn't automatically expand for large amounts of text or wrap onto many lines, but just show what it can. The rest of the text could then be viewed when resizing the column width.

e.g.

Name        Address             Sex
Rob Mo... Trust Court, T... Male
Test Us...  Some Addres...  Female

on column expanding would become:

Name          Address                                       Sex
Rob Moran Trust Court, The Vision Park, H... Male
Test User    Some Address                              Female

Cheers,

Rob

8 Answers, 1 is accepted

Sort by
0
Accepted
Daniel
Telerik team
answered on 11 Jul 2008, 03:34 PM
Hello Rob,

Please take a look at the attached example and tell us whether this is the desired functionality.

Kind regards,
Daniel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rob
Top achievements
Rank 2
answered on 13 Jul 2008, 09:31 AM
Exactly what I was after, thank you very much :)

A few attributres in there I didn't come across in the online documentation it seems.

Cheers,

Rob
0
Rob
Top achievements
Rank 2
answered on 16 Jul 2008, 04:28 PM
Hi Daniel,

I spoke too soon it seems.

Whilst this solution seems to do the trick, it's not possible to resize the columns to see further details of items in that column.
I believe this is due to the fixed layout setting. I've tried removing this (and columns can be resized) but the default column lengths are then set to show everything.

I deally what we would like is a results grid where the columns default to the width of the column header, the row items don't wrap and clip with ellipses and the columns can be resized to show more information.

Cheers,

Rob
0
Daniel
Telerik team
answered on 17 Jul 2008, 08:34 AM
Hi Rob,

Please note that you can't resize a column to the left. This is illustrated in the attached screenshot. If you want to resize the given column, you should move its right border no matter whether it is the outer border of the grid. You can get better idea if you set HeaderStyle-Width to some of the columns and move the Comment column to the middle of your RadGrid.

Let me know whether these directions are helpful.

Kind Regards,
Dainel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rob
Top achievements
Rank 2
answered on 17 Jul 2008, 10:28 AM
Thanks Daniel,

I understand. I suppose the issue is thats it is then impossible to resize the last column as the grid is a fixed width.

Cheers,

Rob
0
Rob
Top achievements
Rank 2
answered on 18 Jul 2008, 01:02 PM
I think we have this setup how we want now.

One issue and one suggestion to point out, though. To get this working the way we want, we have had to "hardcode" column widths as by default the grid draws itself with columns at their maximum length unless the grid is constrained by a width.
And when constrained by width, the scrolling doesn't work.

A good solution would be to be able to tell the grid to make its columns the width of the header text.

And the issue I've found is that column clipping doesn't work in firefox, you can see the text running into other columns.

Cheers,

Rob
0
Daniel
Telerik team
answered on 18 Jul 2008, 03:12 PM
Hello Rob,

About the Firefox behavior:
We will consider this for the future releases of our RadContols suite. Thank you for the suggestion - your Telerik points are updated.

In the meantime you can overcome this issue by using the following workaround:
    <style type="text/css"
        .MasterTable_Default td 
        { 
            overflowhidden
        } 
        .GridHeader_Default 
        { 
            overflowhidden
        } 
    </style> 

In case you are using skin other than Default you should set its name instead of Default.

Regarding the scrolling:
We are not aware of such issue. Can you provide us with an example which illustrates this behavior (attached to a formal support ticket)? We will examine it locally and will get back to you with our findings.

Best regards,
Daniel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Rob
Top achievements
Rank 2
answered on 22 Jul 2008, 03:41 PM
Thanks for the firefox workaround, Daniel. It works a treat.

What I mean by scrolling not working is that if a width is set on the grid, the initial column widths by default are set to (width\column_number) meaning the scroll bars don't appear intitially.
As  I say, we have now hardcoded the column widths and it works as required.

Cheers,

Rob
Tags
Grid
Asked by
Rob
Top achievements
Rank 2
Answers by
Daniel
Telerik team
Rob
Top achievements
Rank 2
Share this question
or