Background:
A while back I designed a custom User Control that I have since embedded in my grid control (ugPoints) using the UltraControlContainerEditor
(See this thread for the details & help I got from this one - http://ko.infragistics.com/community/forums/t/84111.aspx )
Dim ucce As New UltraControlContainerEditorDim ucKV As New ucKVDropDownucce.EditingControl = ucKVucce.EditingControlPropertyName = "Value"With ugPoints.DisplayLayout.Bands(0).Columns("kV") .EditorComponent = ucceEnd With
My custom control ends up displaying a 2 Column Grid mimicking a drop down control - the issue is that the grid column width (in ugPoints) is too narrow to show the entire width of the custom control.
Is there a way to tell the grid or the UltraControlContainerEditor to have a display width greater than the column width (i.e. to behave more like the UltraDropDown control)?
Or am I making this a lot harder than it has to be?
Thanks in advance for any assistance.
Hi,
Well... the easy solution would be to simply set the Width property on the column.
But I assume since you are asking the question that that isn't working or is not sufficient for some reason. But I'm not entirely sure why that would be. Do you want the main grid column to auto-size based on the columns inside your user control?
If you autosize the column in the main grid, by double-clicking the right edge of the column header or calling column.PerformAutoResize, then what the grid does is it uses the GetPreferredSize method on your user control. So to make autosizing work, you would have to autosize the columns in your UserControl grid, get the combined widths, plus any padding or scrollbars, and then override GetPreferredSize on your usercontrol and return the resulting width.
Hi Mike,
Thanks for the reply.
I knew there was no way I could really explain this so after I posted I made a quick sample app. When you run the App, the Column "KV1" is bound to my custom control, "KV2" is bound to a stock UltraDropDown - both of which are using the same List of Custom Object type as their data source.
In a perfect world I'd like my control to behave exactly like the UDD (including when the drop down button appears) but the specific behavior I'm asking about is:
When you drop the UDD - it's drop down width is wider than the grid column width which makes the multi-colum data easy to read / navigate
When you drop my custom control - it is constrained (crammed) into the grid column width making it nearly impossible to use.
In the real application, screen "realestate" is at a premium so making the grid column wider to in turn make the custom control wider is very much not a prefered solution.
In the long run I may be approaching the entire problem wrong. I think it would be much simpler to try and "extend" an UltraDropDOwn to provide the search/filter behavior I need for the grid but I also need this control to be usable directly on a form as well. I know the UltraCombo is for use on a form and that it inherits the UltraDropDown but I've no clue how I would go about developing a single control solution and perhaps that's not really even possible / practical.
Thanks again for your Time and Assistance
Steve
https://p2p.aep.com:443/AEPLargeFile/fileDownload.dsp?isEncrypted=true&isEnSet=true&fileStage=30&fileName=HnVQL2JWj82Jil7UKjzBiHZllwIFc1jWUhHJzb2a3dxkbYxO9SBibA%3D%3D&fop=c86bf950e7f511e3b51bfd68e7f9a2198&version=v2