I'm creating an UltraCombo and populating it with a DataTable. The table has two columns, the first is a boolean named "Selected" and the second is a string named "Name". Here's the code:
DataTable dropdowntable = ColumnValuesProvider.getTable((string)columnMeta["CUSTOM_CONFIG"]); udd.DataSource = dropdowntable; udd.ValueMember = dropdowntable.Columns[1].ColumnName; udd.CheckedListSettings.CheckStateMember = dropdowntable.Columns[0].ColumnName; udd.CheckedListSettings.EditorValueSource = Infragistics.Win.EditorWithComboValueSource.CheckedItems; udd.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item; gridCol.EditorComponent = udd;
(The gridCol variable here is a column in an UltraGrid.)
For testing, the values in the table are { false, "abc", false, "def", true, "ghi" }.
I have two questions. First and most importantly, when I select the drop-down, the checkbox for the third row is unselected. How do I initialize the checkbox so it is checked/unchecked based on the value for the column's value?
Second, and perhaps related, I want the value of the "gridCol" to initially show a comma-separated list based on the rows whose Selected column is true. How can I do this?
Thanks....
Hello,
From your code snipped it seems that you are trying to add ddWorkTypes as editor component of one of its columns. And I assume that the goal is to add ddWorkTypes as editor component of grid. So based on your code snipped I’ve implemented small sample on VB in order to demonstrate you how to configure UltraCombo for multi-select and to add it as editor of UltraGrid column. Please run the same and let me know if this is what you are looking for.
Please let me know if you have any further questions.
Hi I have a similar problem. I'm trying to get "Selected" coulmn to render as a checkbox but it is only returning True/False. My dataset (stored proc) is actually bringing back the "Selected" column as either True or False based on if it is selected.
Any suggestions would be appreciated.
Sub LoadPermitWorkTypes() 'pass in PTWFormId Dim ds As System.Data.DataSet ds = PTWFormDataAccess.LoadPTWWorkTypes(Me.PTWFormId) Dim c As UltraGridColumn = Me.ddlWorkTypes.DisplayLayout.Bands(0).Columns.Add() c.Key = "Selected" c.Width = 40 c.Header.Caption = String.Empty c.Header.CheckBoxVisibility = HeaderCheckBoxVisibility.Always c.DataType = GetType(Boolean) c.Header.VisiblePosition = 0
Me.ddlWorkTypes.DataSource = ds.Tables(0) Me.ddlWorkTypes.DisplayMember = "PTWWorkTypeName" Me.ddlWorkTypes.ValueMember = "PTWWorkTypeNamesId" Me.ddlWorkTypes.CheckedListSettings.CheckStateMember = "Selected" Me.ddlWorkTypes.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems Me.ddlWorkTypes.CheckedListSettings.ItemCheckArea = ItemCheckArea.Item End Sub
Private Sub ddlWorkTypes_InitializeLayout(sender As System.Object, e As Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs) Handles _ ddlWorkTypes.InitializeLayout ddlWorkTypes.DisplayLayout.AutoFitStyle = AutoFitStyle.ExtendLastColumn e.Layout.Bands(0).Columns("Suspended").Hidden = True e.Layout.Override.SelectTypeRow = SelectType.Extended e.Layout.Bands(0).Columns(0).EditorComponent = Me.ddlWorkTypes End Sub
We are still following this forum thread.
Have you been able to take a look at the attached sample?
Please feel free to let us know if you have any other questions with this matter.
Hello ,
As far as I understand you want when you drop-down UltraCombo, which is editor of your UltraGid’s column, to has checked/unchecked items in the UltraCombo, based on the value of UltraGid’s column. When UltraCombo is managed to be multiselect, it returns as value an array of selected items, which meant that data type of your UltraGrid’s column should be of type array or object type. So when you have an array in your UltraGrid’s column, then UltraCombo automatically will select its items, based on the values of the array of the UltraGirdColumn. To be more clear I have implemented a small sample. When you run the sample you will see that in “String[]” column you have a cell with “abc, ghi”, if you open the dropdown you will see that the items with value abc, ghi are checked.
Please let me know if you have any further questions or if I am missing something.