Hi,
I have a grid which as a column that has dropdown as it's style. What I need is the drop down width to be as wide as the column. I tried
myDropDown.DropDownWidth = 0
before assigning it to the ValueList property, but then I get a big brown-gray scare beside my drop down, which of course cause me another problem. I also tried
myDropDown.DropDownWidth = myColumn.Width
but as soon as the user resizes the column, I loose my setting. Is there an event on column resizing? I couldn't find one just by the name.
Any idea?
Thanks,
Stef
You can use the BeforeCellListDropDown event:
Private Sub UltraGrid1_BeforeCellListDropDown(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinGrid.CancelableCellEventArgs) Handles
UltraGrid1.BeforeCellListDropDown
Dim myValList As Infragistics.Win.ValueList = CType
(e.Cell.Column.ValueList, Infragistics.Win.ValueList)
myValList.DropDownListWidth = e.Cell.Width
Sub
Hi Trausti,
Based on your reply, I tried the following code: (C#)
private void ultraGridMeasure_BeforeCellListDropDown(object sender, CancelableCellEventArgs e) {IValueList myValList = (IValueList)e.Cell.Column.ValueList; UltraDropDown drop = (UltraDropDown)myValList; } drop.Width = e.Cell.Width;drop.Rows.Band.Columns[0].Width = e.Cell.Width;}
And it's working perfectly!!
Thanks a lot for your help!!!
Cheers,