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,
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.
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