Suggestion: single-line row with maximum column width

9 posts, 1 answers
  1. Rob
    Rob avatar
    34 posts
    Member since:
    Nov 2007

    Posted 11 Jul 2008 Link to this post

    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
  2. Answer
    Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 11 Jul 2008 Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Rob
    Rob avatar
    34 posts
    Member since:
    Nov 2007

    Posted 13 Jul 2008 Link to this post

    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
  5. Rob
    Rob avatar
    34 posts
    Member since:
    Nov 2007

    Posted 16 Jul 2008 Link to this post

    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
  6. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 17 Jul 2008 Link to this post

    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
  7. Rob
    Rob avatar
    34 posts
    Member since:
    Nov 2007

    Posted 17 Jul 2008 Link to this post

    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
  8. Rob
    Rob avatar
    34 posts
    Member since:
    Nov 2007

    Posted 18 Jul 2008 Link to this post

    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
  9. Daniel
    Admin
    Daniel avatar
    4943 posts

    Posted 18 Jul 2008 Link to this post

    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
  10. Rob
    Rob avatar
    34 posts
    Member since:
    Nov 2007

    Posted 22 Jul 2008 Link to this post

    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017