I have an UltraGrid that I have used the column arranger on. A png of the grid in designer view is attached. There are ten lines of directions that can be displayed. We would like to be able to either set the cell height to zero or something of that nature so if there is only one line of data or a line in the middle is empty, not all of the lines are displayed at runtime so the user does not have a lot of wasted space on the screen. I tried using the hidden property, but it only hides the cell, but leaves the dead space taken. Is what I need to do possible?
Hello,
If you mean for the 'Directions' column from the screenshot to be downsized and to not extend to the width of the grid I believe that this is by default. A property which could cause this is the 'AutoFitStyle'. You could try turning it off(setting it to 'None'):
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.AutoFitStyle = Infragistics.Win.UltraWinGrid.AutoFitStyle.None; }
Please feel free to let me know if I misunderstood you or if you have any other questions.
Yes, the "directions" column is the issue, but it is the height of the individual cells. You see there are ten lines available for customer directions to a business unit in our cell-based app that runs on UNIX. In our new Windows interface, we need to keep the ten lines as ten cells in a grid. Stacking them in the manor shown delivers a view the customers are used to. The issue at hand is this grid is for view only. If a user want to edit the data we pop-up a model form for editing. Since this is for view only, we want to try to present only the "directions" cells that have data and make the grid look cleaner and get more data visible for the screen area available. I tried using hidden, but it just hides the cell in place. I have worked at setting the empty cells to a height of 0 or 1, but cannot find the correct properties. I hope this explains the issue better.
Bob
Boris,
I had already tried the rowsizing and it did not help. To answer your first question, it varies. Sometimes only the first (top) directions cell will be filled, the remaining 9 are empty. Sometimes lines 1, 2, 3, & 5. It varies. I am testing for cell empty in the row initialized event of the grid and the test works fine and drops into the code section for the line in question. It's just getting something to actually reduce the height or whatever it takes to hide the empty cell and consolidate the space.
Hello Bob,
Could you please review the sample attached to this post and see if it meets your requirements. If this project does not reproduce your scenario, please make the needed corrections and send it back to me if it is possible for you.
Attached is my modified version of your sample.
After spending some time researching the desired look by you I believe that the 'WinGrid' does not support this kind of functionality by default and this would be a non-intuitive user interface. You might want to consider putting the 'WinGrid' in cardview mode or using another control for this, like 'UltraTree' for example. However another possible approach to achieve your scenario could be using a 'CreationFilter'. You could read about it at the following link: http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Win_Creation_Filter.html.Here are some topics from our community which could also help you: http://community.infragistics.com/forums/t/34485.aspx, http://forums.infragistics.com/forums/t/47561.aspx http://community.infragistics.com/forums/t/58186.aspx, http://community.infragistics.com/forums/t/9989.aspx and http://community.infragistics.com/forums/t/50234.aspx.
The above approach is not so recommended, because it features element's resizing, creating or removing and could lead to some unexpected behaviors.
Please do not hesitate to ask if something comes up.
Thanks for researching that. We decided to change back to using the grouping style grid and the backend will send all of the rows of directions data as one text string. We can then get the look we want by setting the text for that cell to wrap and then perform the AutoSize when each row is initialized. That gets us close enough to what we wanted. They when the user double-clicks on the row to edit the data, we will put each row into its own grid row for maintenance purposes. Thanks again for helping and doing the leg-work for us.
Thank you for your feedback. I am glad to hear that you have come up with a solution for your 'issue'.
Please feel free to let me know if a question about our toolset comes up on your mind.