I need to resize rows in a grid based on a single columns value. The xRow.PerformAutoSize() method seems to be sizing rows based on the longest text in any column (even if not visible). Is there a way to control this.
Example:
Column A has description
Column B has street address
I want to expand the row size to allow the entire Description to display on a row by row basis. Rows where the Description is blank still resize with .performautosize because the street address does not fit in the cell. I want to ignore the street address in this case.
Thanks in advance for any help or direction.
Hi,
#2 appears to be a bug. I think this is related to an issue that was fixed a while back. I'm going to ask Infragistics Developer Support to create a case for you and write this up for developer review.
For #3, I'm not getting the same results you describe, but I think it might be because I am not doing exactly what you are doing.
Here's what I did:
1) Run the app
2) GroupBy the Name column
3) Expand the first row, so I can see the height.
4) Push button 1. This works - the row height is resized correctly.
5) Push button 2. This adds a new, collapsed, GroupByRow.
6) Here's where I get confused. Pushing button 3 at this point will do nothing, because the rows are already sized. So first, I resized the row manually, then I clicked button 3. This works just fine.
7) Clicking button 4 hides the Description column and the row is automatically autosized and shrunk down.
8) Pushing button 5 does nothing because the row is already sized.
This all seems correct to me.
Sample project attached.
Symptom 1:
Turns out the sample works with the hidden column scenario (so something else is going on in my code). Issue seems to be related to grouping - see Symptom 3
Symptom 2:
When not enough rows are present rows do not size. Provided buttons in step order to illustrate. Step 1 - fails to resize rows, Step 2 - adds blank rows, Step 3 - repeat of step 1 that now works.
Symptom 3:
If you rerun the project and this time first group by name column. note that step 3 does not work but step 5 does after the description column is hidden.
Thanks for your patience - hope this clarifies.
I'm confused. In the screen shot you posted here, which column do you want to ignore? The only column in your screen shot that has more than one line of text is the Notes column. So... if you autosize the row without that column, the row will show only a single line of text and the rest of the text will be clipped. That's what you want?
If so, then I am puzzled by your following statement:
bobRayes said:Additionally, i have noted that if the grid is not full (there is space at the bottom for more rows to be added) the performautosize does not expand the rows. if i squeeze the grid down so that some of the rows are clipped at the bottom then it magically works again.
First, there is no reason why empty space in the grid should have any effect on the row autosizing. But secondly, what do you mean by "expand"? If you hide the Notes column here, then rows will shrink, not expand.
Perhaps you could post a small sample project demonstrating the behavior you are getting so we can take the guess-work out of the issue. :)
Yep - i need to adjust row sizes. if i adjust columns widths the text becomes one long run on sentence that requires too much scrolling. the sizing needs to happen only based on one column and not others. The hide trick seems plausible and is actually the source of my post - performautosize seems to take the hidden rows into account (a behavior i would not expect).
Additionally, i have noted that if the grid is not full (there is space at the bottom for more rows to be added) the performautosize does not expand the rows. if i squeeze the grid down so that some of the rows are clipped at the bottom then it magically works again.
Open to any suggestions. Have attached a screenshot illustrating the situation for clarity. some cells may not have any text and i want those to be minimum height while each other row expands to fit the text in the notes column.
PerformAutoSize on the row changes the row's height based on all of the data in the columns for that row. So... just to be clear, you are concerned here with the height of the row, and not the width of the column. Is that right? I ask because it seems a bit odd - it would seem to make more sense to adjust the width of the description column. But maybe your app is different.
Anyway, the only way I can think of to handle this would be to hide the description column (set column.Hidden = true) before you call PeformAutoSize on the row.