Infragistics XamGrid with different row heights - height

I have a XamGrid that I've got displaying several dynamically generated columns, and one of those columns can have a listbox in it that sizes itself according to how many items are in it (but has a maximum height constraint). I want each row of the XamGrid to basically only be as large as it needs to be - which they are at first, but after scrolling up and down the contents of the grid a bit I find that rows that had hardly any values in the listbox (so should be fairly small in height) are now the same height as the largest rows I've scrolled into view previously. The result is a lot of wasted space, so I'm wondering if anyone knows of a way to make it so that the rows don't automatically resize themselves to match the largest row that has been loaded. I've tried taking a look at the control template but all I see in it are 3 parts and can't see any way to edit or look inside those parts.
PS I would have posted this on Infragistics own support forums but I can't for the life of me actually find any way to post new topics on there even when signed in with my IG account... great design.
Thanks
Chris

Set the RowHeight property to Dynamic. That should take care of the issue for you.
<ig:XamGrid RowHeight="Dynamic" ... >

Related

QTableView, strech all section but the last one resize to content

My table consists of 2 columns: the 1st one stores some strings, the other contains a checkbox only. To make my table a little bit fancy I want to stretch the whole table to the width of its view.
Using
setStretchLastSection(true);
solves the 1st problem. The table looks better, but... OK... the last column is a bit large.
Also I can use
setSectionResizeMode(QHeaderView::Stretch);
The table looks great, but... It isn't my desire. The 1st column should be optimally at least 90% of view's width and the 2nd one small since it contains one checkbox only. Additionally the table shoub be stretched to the view's width. Any Ideas?
Here is a picture just to make my question more understandable)
Here is the solution:
Disable the stretch option for the last column
setStretchLastSection(false);
Set a fixed width for the last column
setColumnWidth(1, fixedWidth)
Stretch the first column
setSectionResizeMode(0, QHeaderView::Stretch)
a bit fancy look

How to check if the length or width of Row in a window is greater than the width of its parent window C++

I wanted to wrap the existing text of checkbox into multiline if the width of row exceeds the width of its parent window. I am not really sure how to do that.
The image I want to show the checkbox string
The image where the string is cropped and only shows if window is resized or maximized
You are going to have a problem with this I am afraid.
The setting for making a checkbox multiline is ES_MULTILINE and if you look here you will see that it states:
To create an edit control using the CreateWindow or CreateWindowEx function, specify the EDIT class, appropriate window style constants, and a combination of the following edit control styles. After the control has been created, these styles cannot be modified, except as noted.
So, it would seem to me that you have three ways forward, depending on what you feel is the best or most elegant for you.
Set your control in the resource editor as multiline anyway. Then it doesn't matter and will wrap. No need to have to change the setting.
Implement the needed functionality to limit the size the window can be reduced to. I can show you how if you are interested. This way, if you set the control resize properties correctly it can resize larger but only reduce down the a known dimension (ie: the dimensions you created it in the resource editor).
Possibly have two controls in the same place, one as multiline and one as single. And when you decide which you want to show, swap the visibility. But I think this is a bad idea, bit of a headache, and not worth the hassle.
IMHO I would do both ideas 1 and 2 and I would happily extend my answer to provide more information.
Update
Having looked at your images and the comments about translations then there is a fourth idea. If you use a third party application to manage the translations and use satellite DLL files then you can adjust the resources on a language by language basis. I sometimes have to make the default width for some windows wider due to their verbose nature.
I have set BS_MULTILINE for the checkbox. The minimum size of the window is fixed but I just want the checkbox to fit in that. I expect it to show at least one word in the same line as other labels and remaining words in second line. So I am checking if the total width of the first row is greater than the width of window then show the string with \r\n in it else show normal string. However, I want to align first line or the first word of the checkbox with the checkbox and remaining words should come below the first word. Currently, the checkbox is in between two lines which looks weird. Is there anyway I can do this?

Infragistics UltraGrid rows displayed from bottom to top

I need to display rows in UltraGrid starting from bottom and going towards the top rather then normally where they are displayed from the top to the bottom.
Is there a setting of a property that needs to be set to achieve this display? I can't seem to find it.
Example of required layout
This functionality isn't built into the WinGrid control and you should log a new product idea on the NetAdvantage for Windows Forms product idea page for this if you are looking for this functionality.
You may be able to do something like this using a creation filter to move the existing rows if there are not enough rows to fill the grid. If you do pursue this you would still need to sort the rows so that they are already in the correct order first and they you would move the existing rows down when they don't fill the entire grid. There are more details on creation filters in the help.

QTableView sizing issue

I am using Qt 4.2. I have a window with two separate tables using the QTableView and QAbstractTableModel. The tables seem to have extra space below the rows ending, and to the right of the columns ending. My solution up to this point with other windows has been to calculate the size of the table (based on cell size, plus a little extra for the border) and set the fixed width and height. This solution is a pain for tables that have different size columns. I am looking for a solution where my QTableView class does not have to set its own fixed size, but rather the table just ends at the last row and column. I do not want to use setStretchLastColumn(). Any suggestions to get these tables to behave properly without having to calculate and set a fixed size would be very helpful. Thanks.

Auto resizing column widths in a CListCtrl

How can I make a CListCtrl to resize the width of its columns automatically? Usually, when an item in the list gets too long, the back end disappears from view and the user manually has to resize the width of the corresponding column.
Is there any way to do this by code?
Resizing the columns automatically is easy:
for(int i = 0;i < pListCtrl->GetHeaderCtrl()->GetItemCount();++i)
pListCtrl->SetColumnWidth(i,LVSCW_AUTOSIZE_USEHEADER);
This will optimize the columns.
Do you have the "No Scroll" option on? By default ("No Scroll" option off), if an item got too long a scroll bar would appear.
I assume you mean a list control in report mode? Unfortunately there is no way to automatically resize columns. What you can do (what I do in some places) is calculate the width of columns as you enter items, then handle WM_SIZE and resize the columns. However this causes changes that the user made to be lost, so you may need a better algorithm like tracking if the user made any changes, if he did don't resize. It's not very nice from a UX perspective, I only use it in a select amount of circumstances where the behavior makes sense in the context of the rest of the UI.