Fixing Column Widths Permanently

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Fixing Column Widths Permanently

    I have a datagrid that I'm using to show a list of hierarchical data,
    much like a tree-view. I won't go into the detail, suffice to say that
    the reason I'm doing this is because of the poor quality of the data
    (imported from a legacy system) and the manner in which the database
    has had to be designed to accommodate this; in no way is it ideal, but
    we have no other options but to do it this way.

    Anyhoo, when I expand each level (columns going left-to-right), I'm
    finding that if the text in the next column is wider than the
    column-width that has been set, it expands to some degree to
    accommodate the text.

    Does anyone know how I can possibly fix the widths to prevent them from
    widening/narrowing so that the surrounding columns don't 'shift' from
    right-to-left and back again?

    Just so you know, I've set the following values:
    ItemStyle-Width
    HeaderStyle-Width
    ItemStyle-CssClass (width defined in the class)

    I've also tried setting text-overflow: ellipsis, but it didn't do
    anything! A shame, since that would have been perfect. I've had
    moderate success with Style.Add("WORD-BREAK", "break-all"), but it's
    still not perfect and in any case, the results are not great.

    Any help on this would be appreciated.

    DarthMcAdam Guest

  2. Similar Questions and Discussions

    1. AdvancedDataGrid column widths
      Hi, Is is possible to configure the AdvancedDataGrid so that the column widths are determined by the data displayed, so that each column is as...
    2. Custom Column Widths
      I have a datagrid which displays five columns of data. Since several columns display "Y" or "N" or 1-9 I have modified all the column widths to...
    3. Datagrid column widths
      I try to format the column widths in the property builder/ Format area. Then when I run it the formating is not there??? -- ...
    4. consistent column widths
      ASP.NET 2003. Two DataGrids, six columns each, one grid atop the other. I need to have the columns line up, i.e., DataGrid1 Col(1) lined up w/...
    5. Report column widths
      I would like to have reports whose columns adjust horizontally to data width. Years ago I used filemaker and it had a 'slide' capability for...
  3. #2

    Default Re: Fixing Column Widths Permanently

    One way to workaround is to trim text to fixed length and the assign whole
    text to ToolTip of the cell.

    HTH


    "DarthMcAdam" <adam@adsandtaz.com> wrote in message
    news:1129296870.556371.260710@o13g2000cwo.googlegr oups.com...
    >I have a datagrid that I'm using to show a list of hierarchical data,
    > much like a tree-view. I won't go into the detail, suffice to say that
    > the reason I'm doing this is because of the poor quality of the data
    > (imported from a legacy system) and the manner in which the database
    > has had to be designed to accommodate this; in no way is it ideal, but
    > we have no other options but to do it this way.
    >
    > Anyhoo, when I expand each level (columns going left-to-right), I'm
    > finding that if the text in the next column is wider than the
    > column-width that has been set, it expands to some degree to
    > accommodate the text.
    >
    > Does anyone know how I can possibly fix the widths to prevent them from
    > widening/narrowing so that the surrounding columns don't 'shift' from
    > right-to-left and back again?
    >
    > Just so you know, I've set the following values:
    > ItemStyle-Width
    > HeaderStyle-Width
    > ItemStyle-CssClass (width defined in the class)
    >
    > I've also tried setting text-overflow: ellipsis, but it didn't do
    > anything! A shame, since that would have been perfect. I've had
    > moderate success with Style.Add("WORD-BREAK", "break-all"), but it's
    > still not perfect and in any case, the results are not great.
    >
    > Any help on this would be appreciated.
    >

    Elton Wang Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139