0

My project needs to display a list of contacts in a grid. Normal data - First Name, Last, City, State, Zip, Email, Phone, Company Name.

1 - We need to support wide variation in screen widths 800px -> 2,000px.

2 - We want to display as much information as possible, with as little white space as possible.

3 - As the grid gets wider, we want some fields to expand (Organization Name), others to stay at a maximum Width (State - 2 char).

None of the standard column resize modes seem to work since there is no Max Width column. The State column ends up with a ton of space, and the organziation is still being chopped off.

Has anyone resolved this problem?

Yu Hao
  • 119,891
  • 44
  • 235
  • 294
dbower60
  • 87
  • 6

1 Answers1

0

I had similar problems with our Gridview and I have raised a ticket with Devexpress team for the same reasonsDevexpress ticket. It seems SetWidth() client side JS method does not work properly when you have fixed width columns.

In your case, I would suggest using percentage size for your columns which needs to be dynamically expanded and static size for the other ones.Also set the text wrap true for cells that you want texts tightly wrapped inside.

    settings.Columns.Add(column =>
    {
        var commmonHeaderStyle = column.HeaderStyle as GridViewHeaderStyle;
        commmonHeaderStyle.Font.Bold = true;
        column.CellStyle.Wrap = DefaultBoolean.True;
        column.FieldName = "Test";
        column.Width = System.Web.UI.WebControls.Unit.Percentage(30);

    });

You might also want to take a look at this example : Full Screen mode (100% browser Width and Height)

Ramesh Sivaraman
  • 1,295
  • 3
  • 19
  • 32