Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8658659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:49:24+00:00 2026-06-12T15:49:24+00:00

ListGrid listGrid = new ListGrid(); listGrid.setWidth100(); listGrid.setFields(f1, f2); vlayout.addMember(listGrid); listGrid.setAutoFitFieldsFillViewport(false); listGrid.setAutoFitFieldWidths(false); listGrid.setCanAutoFitFields(false); ListGridField[] listGridFields

  • 0
ListGrid listGrid = new ListGrid();

listGrid.setWidth100();

listGrid.setFields(f1, f2);
vlayout.addMember(listGrid);

listGrid.setAutoFitFieldsFillViewport(false);
listGrid.setAutoFitFieldWidths(false);
listGrid.setCanAutoFitFields(false);

ListGridField[] listGridFields = listGrid.getFields();
for (ListGridField listGridField : listGridFields) {
  listGridField.setAutoFitWidth(true);
}

I’ve got this lines but when I resize the window in which I put listGrid, the fields do not resize and fit the new width.

Could someone help me to make the width of the fields of this listGrid fit the window ?

Then if I put this :

ListGridField[] listGridFields = listGrid.getFields();
for (ListGridField listGridField : listGridFields) {
  listGridField.setWidth("100%");
}

It resolve the problem when I resize the window on first time. But resizing a field make a gap on the right between the last field and border of the listGrid.

Is there a way to solve this ?

Summary :
Is there a way to make the listGrid atomatically resize with resizing of the window ?
Is there a way to make the fields of the listGrid always fit the size of listGrid which always fit the width of its parent ?

Is that possible to have this result : http://jsfiddle.net/lnplnp/kJLGd/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T15:49:25+00:00Added an answer on June 12, 2026 at 3:49 pm

    Finally I’ve tried listGridField.setWidth("100%");

    So the answer is :

    ListGridField[] listGridFields = listGrid.getFields();
    for (ListGridField listGridField : listGridFields) {
      listGridField.setWidth("100%");
    }
    listGrid.getField("FIELDNAME").setWidth(30);
    

    Assigned a fix width to at least one field, respond to my expectation.

    It work in most of case but sometime this method does not work correctly. I cannot describe the exact situation. I will edit this response if I found what make it does not work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code snippet: final ListGrid subscriberGrid = new ListGrid(); subscriberGrid.setWidth(500); subscriberGrid.setHeight(224); subscriberGrid.setShowAllRecords(true);
I have a View where I have Drag and Drop working between 2 ListGrid-s,
Is it possible to replicate the search functionality found in ListGrid and implement it
Is that possible to listen click event on a row of a ListGrid ?
I'm working with SmartClient release 8.3. I configured this DataSource: <DataSource ID=example serverType=hibernate dropExtraFields=true
I have a ListGrid with filter editor set to visible. Normally if I type
I am trying to use smart Gwt, Listgrid. I am using both com.google.gwt.user.client.ui and
Hi I have a listgrid in smartgwt and I need to have a button
I have noticed after some research that smartGWT don't support pagination in the ListGrid
When the user clicks a button, I want to fire the ListGrid Selection event.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.