Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
725
UltraControlContainerEditor in grid not displaying embedded control as desired
posted

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 UltraControlContainerEditor
Dim ucKV As New ucKVDropDown
ucce.EditingControl = ucKV
ucce.EditingControlPropertyName = "Value"
With ugPoints.DisplayLayout.Bands(0).Columns("kV")
    .EditorComponent = ucce
End 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.

Parents
  • 469350
    Offline posted

    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.

Reply Children