Hi ,
I have attached a ultradropdown to ultragird as valueslist in a column.
my first row of the dropdwon text is "NONE", when i select the NONE row i want to replace the NONE witht the string.empty. but it is not allowing me to change the text.
When i change the text in the grid ultradropdonw events are not fireing.
i have handed the same for the ultracombo it is working fine.
protected override void OnAfterCloseUp(EventArgs e) { base.OnAfterCloseUp(e);
if (this.Text == " {None}") { this.Value = null; this.Text = string.Empty;
} }
Please help me in this regard.
Thanks
Subbu.
Hi Subbu,
I'm not sure I follow you. But my guess is that the Style of the column is set to DropDownList and therefore the cell will not accept a value that is not on the list.
Also, changing the value of the cell in OnAfterCloseUp might be too early. Perhaps this code you have here is working, but then the control is overwriting the text with some other value.
I don't think you will be able to do this by setting the Value. A better way to do this might be to use a DataFilter so that you could translate the Editor value of the control "{None}" into a display value of an empty string, and vice versa.
Hi Mike,
Thanks for your replay. Filters will not server my problem.
You didn’t understand my problem.
Here is my code
Dim bddValueList As New UltraDropDown
Private Sub grdSearchResults_InitializeLayout(ByVal sender As Object, _
ByVal e As InitializeLayoutEventArgs) _
Handles grdSearchResults.InitializeLayout
bddValueList= generateDropDown () ‘ generateDropDown () function will return UltraDropDown(wrapper class )
e.Layout.Bands(0).Columns(1).ValueList = bddValueList
End Sub
With this my grid will be ready with my UltraDropDown as column.
Now I have “{none}” as an option in my Dropdown. When I select “{none}” form my Dropdown it has replace with string. Empty (my business requirement).
Option one: -
How can I achieve this?
Option two:-
I have overridden the events of DropDown (wrapper on top of UltraDropDown). This event are not firing when I change/close/leave the dropdown in the grid.
If, I am able to fire this events my problem will be solved. But these events are not firing when the dropdown is in the grid.
protected override void OnAfterCloseUp(Infragistics.Win.UltraWinGrid.DropDownEventArgs e)
{
base.OnAfterCloseUp(e);
if (this.Text == " {None}")
this.Text = string.Empty;
}
protected override void OnAfterDropDown(Infragistics.Win.UltraWinGrid.DropDownEventArgs e)
base.OnAfterDropDown(e);
if ( (this.Text == " {None}" || this.Text == string.Empty))
if (this.Rows.Count > 0)
this.ActiveRow = this.Rows[0];
protected override void OnLeave(EventArgs e)
base.OnLeave(e);
Please help me with code ASAP.