Hello,
I am adding UltraOptionSet as column to my UltraWinGrid in InitializeLayout event.
Code is as follows:
UltraOptionSet ultraOption = new UltraOptionSet(); Infragistics.Win.ValueListItem valY = new Infragistics.Win.ValueListItem(); Infragistics.Win.ValueListItem valN = new Infragistics.Win.ValueListItem(); valY.DataValue = true; valN.DataValue = false; valY.DisplayText = "Yes"; valN.DisplayText = "No"; ultraOption.Items.AddRange(new Infragistics.Win.ValueListItem[] { valY, valN }); e.Layout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False; e.Layout.Bands[ONE].Columns.Add("Select"); e.Layout.Bands[ONE].Columns["Select"].DataType = typeof (bool);
e.Layout.Bands[ONE].Columns["Select"].EditorComponent = ultraOptionSet;
e.Layout.PerformAutoResizeColumns(false, Infragistics.Win.UltraWinGrid.PerformAutoSizeType.VisibleRows);
When I run my application only "No" values are selected and I can not change selected values.
I want to get selected value either Yes or No in collection.
Please let me know better way to implement it.
Please see attachment to see how it looks like.
Thanks,
Imran
Dimitar,
Thanks for your quick response.
My problem is solved.
You were right, my grid was not editable.
Thanks for your help.
Hello Imran,
Thank you for contacting Infragistics Developer Support. For some reason I am unable to see the attached images.
I have tried to reproduce your issue and everything works fine on my machine – I can select both the “Yes” and “No” options of the UltraOptionSet. Is your grid editable? Can you please make sure that you haven’t set the CellClickAction or the Activation properties to something that prevents editing? You could add the following line to your code and it will make the column editable:
e.Layout.Bands[ONE].Columns["Select"].CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
Another thing that might be causing the issue is that from your code snipped you are creating ultraOption and you are setting the EditorComponent to ultraOptionSet. Please make sure that this isn’t causing the issue. Other than that your code seems fine.
If those suggestion doesn’t help you solve your issue, please modify the attached sample so it reproduces your issue. I will be glad to continue investigating your issue once I have the modified sample.
I am looking forward to your reply.