Good morning,
I have two cells that have to be setup with a dropdown list of items with the checkbox selection feature.
To allow user to make multiple selections for the item.
It appears to work great. Both have their selection lists and the checkboxes next to them.
The thing is the first list only shows one item, the first in the checked off list, as checked off.
Even though the items appear in the list as checked off.
The second list works perfectly fine and shows the number of items checked off.
Both use the same code to set themselves up and to read back what was selected.
So why does the first one only show one item checked off when there is more then one actually checked off?
Hope that explains things. Code below.
Under the grids InitializeRow sub:
objDDL = objTools.DBuwEdComboInit(objDDL, (strSQLIs), strWhoAmI, msUserName, strConnStrToUse)
Dim objTool As Infragistics.Win.UltraWinToolbars.ComboBoxToolobjTool = uwTBMgr.Ribbon.Tabs("Home").Groups("Home - Available Reports").Tools("Reports")Select Case objTool.Text Case "Order List Details" With objDDL .AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest .SortStyle = Infragistics.Win.ValueListSortStyle.Ascending .DropDownStyle = Infragistics.Win.DropDownStyle.DropDown Dim intVisItemcount As Integer = objDDL.Items.Count If (intVisItemcount > 100) Then intVisItemcount = 100 End If .MaxDropDownItems = intVisItemcount .CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox End With Case Else End Select e.Row.Cells("Value/Choices").EditorComponent = objDDL
And when I am reading back the items checked off,
-- 2nd Cell read back, on the next rowDim intItemsSelected As Integer = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems.CountIf (intItemsSelected > 0) Then Dim intItemsIDX As Integer = 0 While (intItemsIDX < intItemsSelected) strItemIs = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems(intItemsIDX).DisplayText msFilters(3) = msFilters(3) & "''" & strItemIs & "'', " intItemsIDX += 1 End While 'check for last COMA strItemIs = msFilters(3) strItemIs = StrReverse(StrReverse(strItemIs).Substring(2, (StrReverse(strItemIs).Length - 2))) msFilters(3) = strItemIsElse msFilters(3) = .Rows(intFilterOn).Cells("Value/Choices").Text Select Case msFilters(3) Case "", "--- Choose One ---" msFilters(3) = "" Case Else msFilters(3) = " ''" & msFilters(3) & "'' " End SelectEnd If
Anyone?
This one is driving me nuts.
That first dropdownlist is just refusing to actknowledge that any of the checkboxes after the first one is checked off. yet it shows it as such.
And the 2nd on, in the same column just the next row, works perfectly fine.
Help!
Hello tirnaog,
It is very hard for me to run the code provided in your first post. Could you please attach a small sample project reproducing the issue, I will be happy to take a look at it and assist you further on that matter.
Thanks for the reply.
Hopefully you will find attached a zip with the test project files and a test DB.
{nevermind 200K wont work at all for the zip file :( }
Test Db is in SQL backup file format. SQL Version: 10.50.2500
The Infragistics version of the controls I am using is: 10.2.20102.1004
The test project is doing a slight different result from the main project.
Both dropdownlists are only returning a count of 1 for the checked off items.
Even though they display the correct items chosen.
In the main project the 2nd drop down list is correctly returning the number of checked off items.
the form has a wingrid control and a ultracomboeditor on it.
Also 2 btns and 2 labels.
Is there any way I can get the test DB backup file to you?
thats needed for the various tables and SPs referenced.
I will try pasting the code in here:
Imports System.Data.SqlClient 'MS-SQL interface
Public Class Form1
Friend msFilters As String() Dim msConnstr As String = "Data Source=<server name>;user id=<user ID>;password=<password>;initial catalog=testObjects;Connection Timeout=3400000"
Private Sub btnBegin_Click(sender As System.Object, e As System.EventArgs) Handles btnBegin.Click
Try uwGrid_RptFilters = DBuwGridInit(uwGrid_RptFilters, String.Format("EXEC SP_Soda_RptMgr_getListOfFiltersForGivenRpt '{0}'", "Provisioning - Order List Details"), "btnBegin_Click", "Me", msConnstr) With uwGrid_RptFilters
.DisplayLayout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True .DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.Edit
.DisplayLayout.Bands(0).Columns("ID").Hidden = True .DisplayLayout.Bands(0).Columns("ChoicesSource").Hidden = True .DisplayLayout.Bands(0).Columns("Condition").Hidden = True .DisplayLayout.Bands(0).Columns("ConditionalSource").Hidden = True .DisplayLayout.Bands(0).Columns("Type").Hidden = True .DisplayLayout.Bands(0).Columns("Position").Hidden = True .DisplayLayout.Bands(0).Columns("FieldIs").Hidden = True .DisplayLayout.Bands(0).Columns("RptFieldID_FK").Hidden = True .DisplayLayout.Bands(0).Columns("UseQuotes").Hidden = True .DisplayLayout.Bands(0).Columns("WhereClauseSyntax").Hidden = True .DisplayLayout.Bands(0).Columns("ConditionalValue").Hidden = True .DisplayLayout.Bands(0).Columns("InitValue").Hidden = True .DisplayLayout.Bands(0).Columns("InitEndValue").Hidden = True End With Catch ex As Exception
End Try End Sub
#Region "Grid: Filters "
Private Sub uwGrid_RptFilters_InitializeRow(sender As Object, e As Infragistics.Win.UltraWinGrid.InitializeRowEventArgs) Handles uwGrid_RptFilters.InitializeRow Dim strWhoAmI As String = My.Application.Info.Title & "." & Me.Name & ".uwGrid_RptFilters_InitializeRow" Dim strWhoCalledMe As String = "Grid Init!" Dim strResult As String = "False" Dim strConnStrToUse As String = msConnstr Me.Cursor = Cursors.WaitCursor Try Select Case e.Row.Cells("Type").Text Case "DDL" If (e.Row.Cells("Value/Choices").Tag = "GotList") Then Else Dim objDDL As New Infragistics.Win.UltraWinEditors.UltraComboEditor Dim strSQLIs As String = e.Row.Cells("ChoicesSource").Text Try Select Case strSQLIs Case ""
Case Else strSQLIs = String.Format(strSQLIs, "SC1SQL1") End Select Catch ex As Exception
End Try
Select Case e.Row.Cells("Filters").Text Case "" Case Else strSQLIs = String.Format(strSQLIs, "") End Select
Select Case strSQLIs.IndexOf("Status") Case Is > 0 Dim objDDL1 As New Infragistics.Win.UltraWinEditors.UltraComboEditor objDDL1 = DBuwEdComboInit(objDDL1, (strSQLIs), strWhoAmI, "Me", strConnStrToUse) With objDDL1 .AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest .SortStyle = Infragistics.Win.ValueListSortStyle.Ascending .DropDownStyle = Infragistics.Win.DropDownStyle.DropDown Dim intVisItemcount As Integer = objDDL1.Items.Count If (intVisItemcount > 100) Then intVisItemcount = 100 End If .MaxDropDownItems = intVisItemcount .CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox End With e.Row.Cells("Value/Choices").EditorComponent = objDDL1 e.Row.Cells("End Range Value").EditorComponent = objDDL1 Case Else Dim objDDL2 As New Infragistics.Win.UltraWinEditors.UltraComboEditor objDDL2 = DBuwEdComboInit(objDDL2, (strSQLIs), strWhoAmI, "Me", strConnStrToUse) With objDDL2 .AutoCompleteMode = Infragistics.Win.AutoCompleteMode.Suggest .SortStyle = Infragistics.Win.ValueListSortStyle.Ascending .DropDownStyle = Infragistics.Win.DropDownStyle.DropDown Dim intVisItemcount As Integer = objDDL2.Items.Count If (intVisItemcount > 100) Then intVisItemcount = 100 End If .MaxDropDownItems = intVisItemcount .CheckedListSettings.CheckBoxStyle = Infragistics.Win.CheckStyle.CheckBox End With e.Row.Cells("Value/Choices").EditorComponent = objDDL2 e.Row.Cells("End Range Value").EditorComponent = objDDL2 End Select
If (e.Row.Cells("ConditionalValue").Text <> "") Then e.Row.Cells("Value/Choices").Value = e.Row.Cells("InitValue").Text End If
If (e.Row.Cells("ConditionalValue").Text <> "") Then e.Row.Cells("End Range Value").Value = e.Row.Cells("InitEndValue").Text End If e.Row.Cells("Value/Choices").Tag = "GotList" End If If (e.Row.Cells("Condition").Text = "Y") Then If (e.Row.Cells("ConditionalSource").Text <> "None") Then Dim objDDL As New Infragistics.Win.UltraWinEditors.UltraComboEditor objDDL = DBuwEdComboInit(objDDL, ("EXEC " & e.Row.Cells("ConditionalSource").Text), strWhoAmI, "Me", msConnstr) e.Row.Cells("Conditional").EditorComponent = objDDL e.Row.Cells("Conditional").Value = e.Row.Cells("ConditionalValue").Text End If End If Case "DTF"Make_a_dTDropDown: Dim objDFT As New Infragistics.Win.UltraWinEditors.UltraDateTimeEditor e.Row.Cells("Value/Choices").EditorComponent = objDFT If (e.Row.Cells("Value/Choices").Value Is DBNull.Value) Then Else If (e.Row.Cells("Value/Choices").Value = "") Then e.Row.Cells("Value/Choices").Value = e.Row.Cells("InitValue").Text End If
e.Row.Cells("End Range Value").EditorComponent = objDFT If (e.Row.Cells("End Range Value").Value Is DBNull.Value) Then Else If (e.Row.Cells("End Range Value").Value = "") Then e.Row.Cells("End Range Value").Value = e.Row.Cells("InitEndValue").Text End If End If
If (e.Row.Cells("Condition").Text = "Y") Then If (e.Row.Cells("ConditionalSource").Text <> "None") Then Dim objDDL As New Infragistics.Win.UltraWinEditors.UltraComboEditor objDDL = DBuwEdComboInit(objDDL, ("EXEC " & e.Row.Cells("ConditionalSource").Text), strWhoAmI, "Me", msConnstr) e.Row.Cells("Conditional").EditorComponent = objDDL If (e.Row.Cells("Conditional").Value = "") Then e.Row.Cells("Conditional").Value = e.Row.Cells("ConditionalValue").Text End If End If End If End If
Case "DTF" Dim objDFT As New Infragistics.Win.UltraWinEditors.UltraDateTimeEditor e.Row.Cells("Value/Choices").EditorComponent = objDFT If (e.Row.Cells("Value/Choices").Value Is DBNull.Value) Then Else If (e.Row.Cells("Value/Choices").Value = "") Then e.Row.Cells("Value/Choices").Value = e.Row.Cells("InitValue").Text End If
Case Else
End Select Catch ex As Exception
End Tryend_Sub: Me.Cursor = Cursors.Default End Sub
#End Region
''' <summary> ''' Init.s given Infragistics Grid for the app. ''' </summary> ''' <param name="objDBGridToInit">The Infragistics listbar object to be initilized.</param> ''' <param name="strSQLToUse">The SQL command to be run.</param> ''' <param name="strWhoCalledMe">Who called this Procedure or Function.</param> ''' <remarks>Given the listbar object and SQL cmd I will init. the listbar with the parrents and children results.</remarks> Public Function DBuwGridInit(ByVal objDBGridToInit As Infragistics.Win.UltraWinGrid.UltraGrid, ByVal strSQLToUse As String, ByVal strWhoCalledMe As String, ByVal strUserID As String, Optional ByVal strConnStrToUse As String = "None Given") As Infragistics.Win.UltraWinGrid.UltraGrid Dim strWhoAmI As String = My.Application.Info.Title & ".clsCommonTools.DBuwGridInit" Try Dim dvOrderList As New DataView dvOrderList = DBgetDataView("TBL_DataRows", strSQLToUse, strWhoAmI, strConnStrToUse, strUserID) If (dvOrderList.Count > 0) Then
With objDBGridToInit .DataSource = Nothing .DataSource = dvOrderList .SetDataBinding(dvOrderList, "") .Rows(0).Activate() .ActiveRow.Selected = True ' .Rows(0).Selected = True .Visible = True If (.Rows(objDBGridToInit.Selected.Rows(0).Index).HasChild = True) Then .Rows(objDBGridToInit.Selected.Rows(0).Index).Expanded = True .Rows(objDBGridToInit.Selected.Rows(0).Index).ChildBands.FirstRow.Activate() .Rows(objDBGridToInit.Selected.Rows(0).Index).ChildBands.FirstRow.Selected = True .Rows(objDBGridToInit.Selected.Rows(0).Index).ChildBands.ParentRow.Selected = False End If End With
Else With objDBGridToInit .DataSource = dvOrderList .SetDataBinding(dvOrderList, "") .Visible = True End With End If Catch ex As Exception
End TryHell: DBuwGridInit = objDBGridToInit End Function
''' <summary> ''' Makes the DB connection and fills the dataview, which is then returned. ''' </summary> ''' <param name="strTBLName">Table name for the Dataview.</param> ''' <param name="strSQL">The SQL command to be run.</param> ''' <param name="strWhoCalledMe">Who called this Procedure or Function.</param> ''' <param name="strUserID">Network Id of web page Visitor.</param> ''' <remarks>Makes the DB connection and fills the dataview, which is then returned. Uses applications default DB connection str.</remarks> Public Function DBgetDataView(ByVal strTBLName As String, ByVal strSQL As String, ByVal strWhoCalledMe As String, Optional ByVal strConnStrToUse As String = "None Given", Optional ByVal strUserID As String = "Unknown", Optional ByVal strWhoCalledMyCaller As String = "None") As Data.DataView Dim strWhoAmI As String = My.Application.Info.Title & ".clsCommonTools.DBgetDataView" Dim strTableName As String = "" Dim dvDataView As New Data.DataView Dim dsDataSet As New Data.DataSet Dim strOldSQLCmd As String = strSQL Dim msConnectionStr As String = "" Dim Connection As New SqlConnection
Try If (strConnStrToUse = "None Given") Then Connection.ConnectionString = My.Settings(My.Settings("CStr_ConnToUse")) Else Connection.ConnectionString = strConnStrToUse End If Dim Adapter As New SqlDataAdapter(strSQL, Connection) Adapter.SelectCommand.CommandTimeout = 540000
Adapter.Fill(dsDataSet, strTBLName) Connection.Open() dvDataView.Table = dsDataSet.Tables(strTBLName) Adapter.Dispose() Connection.Close() Connection.Dispose()
Catch ex As Exception
Finally If (Connection.State <> Data.ConnectionState.Closed) Then Connection.Close() End If End Try DBgetDataView = dvDataView End Function
''' <summary> ''' Init.s given Infragistics Editor Combo for the app. ''' </summary> ''' <param name="objEditorToInit">The Infragistics Editor Combo object to be initilized.</param> ''' <param name="strSQLCMD">The SQL command to be run.</param> ''' <param name="strWhoCalledMe">Who called this Procedure or Function.</param> ''' <param name="strUserID">The users Network ID who called me.</param> ''' <param name="strConnStrToUse">Optional connection string to use.</param> ''' <remarks>Given the Combo Editor object and SQL cmd I will init. </remarks> Public Function DBuwEdComboInit(ByVal objEditorToInit As Infragistics.Win.UltraWinEditors.UltraComboEditor, ByVal strSQLCMD As String, ByVal strWhoCalledMe As String, ByVal strUserID As String, Optional ByVal strConnStrToUse As String = "None Given", Optional ByVal strOrdID As String = "0") As Infragistics.Win.UltraWinEditors.UltraComboEditor Dim strWhoAmI As String = My.Application.Info.Title & ".clsCommonTools.DBuwEdComboInit" Try Dim dsAnswer As New DataSet Dim dvOrderList As New DataView dsAnswer = getDropDownListItems("", "", strSQLCMD, strConnStrToUse, strWhoAmI, strUserID) Dim dvTheItems As New Data.DataView dvOrderList = dsAnswer.Tables(0).AsDataView If (dvOrderList.Count > 0) Then dvOrderList = AddRowToDV(dvOrderList, "--- Choose One ---", strWhoAmI, strUserID) Dim intIndex As Integer = 0 objEditorToInit.Items.Clear() While (intIndex < dvOrderList.Count) With objEditorToInit .Items.Add(dvOrderList.Item(intIndex).Item("Value"), dvOrderList.Item(intIndex).Item("Result")) End With intIndex += 1 End While Else dvOrderList = AddRowToDV(dvOrderList, "--- Choose One ---", strWhoAmI, strUserID) dvOrderList = AddRowToDV(dvOrderList, "No Entries Found", strWhoAmI, strUserID) Dim intIndex As Integer = 0 objEditorToInit.Items.Clear() While (intIndex < dvOrderList.Count) With objEditorToInit .Items.Add(dvOrderList.Item(intIndex).Item("Value"), dvOrderList.Item(intIndex).Item("Result")) End With intIndex += 1 End While End If Catch ex As Exception
End TryHell: DBuwEdComboInit = objEditorToInit End Function
Public Function getDropDownListItems(strRptWanted As String, strRptGrpID As String, strSQLCMD As String, strConnStrToUse As String, ByVal strWhoCalledMe As String, ByVal strUserName As String) As DataSet Dim strWhoAmI As String = My.Application.Info.Title & ".Tools.getDropDownListItems" Dim dsAnswer As New DataSet Dim strConnStr As String = strConnStrToUse Dim strResult As String = "False" Try dsAnswer = Rpt_Report(strSQLCMD, strConnStr, strUserName, strWhoAmI) Catch ex As Exception
End Try getDropDownListItems = dsAnswer End Function
''' <summary> ''' run requested report ''' </summary> ''' <param name="strSQLCMD">SQL CMD to run.</param> ''' <param name="strUserName">The user who asked for this to be run.</param> ''' <param name="strWhoCalledMe">Who called this Procedure or Function.</param> ''' <remarks>Returns a dataset with the rpts result in table 0.</remarks> Private Function Rpt_Report(strSQLCMD As String, strConnStrToUse As String, strUserName As String, strWhoCalledMe As String) As DataSet Dim strWhoAmI As String = My.Application.Info.Title & ".Tools.Rpt_Report" Dim strResult As String = "" Dim dsAnswer As New DataSet Try Dim dvOrderList As New DataView dvOrderList = DBgetDataView("TBL_DataRows", strSQLCMD, strWhoAmI, strConnStrToUse, strUserName) dsAnswer = dvOrderList.Table.DataSet Catch ex As Exception
End Try Rpt_Report = dsAnswer End Function
''' <summary> ''' Adds a row to a dataview with given item and value ''' </summary> ''' <param name="dvDVToWorkOn">The Dataview the item needs to be added to.</param> ''' <param name="strItemToAdd">The Item to be added.</param> ''' <param name="strWhoCalledMe">Who called this Procedure or Function.</param> ''' <param name="strValueToAdd">If there is a value to be added also then here be where you puts it.</param> ''' <remarks>Adds a row to a dataview with given item and value. Mainly used to add '--- Choose One ---' to dataviews used for Drop down lists.</remarks> Friend Function AddRowToDV(ByVal dvDVToWorkOn As DataView, ByVal strItemToAdd As String, ByVal strWhoCalledMe As String, ByVal strUserID As String, Optional ByVal strValueToAdd As String = "") As DataView Dim strWhoAmI As String = My.Application.Info.Title & ".clsCommonTools.AddRowToDV" Try Dim objDVrow As System.Data.DataRowView = dvDVToWorkOn.AddNew With objDVrow .Item(0) = (strItemToAdd) If (strValueToAdd.Length > 0) Then .Item(1) = (strValueToAdd) End If End With Catch ex As Exception
End Try AddRowToDV = dvDVToWorkOn End Function
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim strWhoAmI As String = My.Application.Info.Title & "." & Me.Name & ".SetFilterValues" Dim strResult As String = "" Dim strSQLCMD As String = "" Try With uwGrid_RptFilters .DisplayLayout.Bands(0).Columns("Position").SortIndicator = Infragistics.Win.UltraWinGrid.SortIndicator.Ascending ReDim msFilters(.Rows.Count) Dim intIDX As Integer = 0 Dim intFilterOn As Integer = 0 While (intFilterOn < .Rows.Count) Dim strDoBetween As String = "N" If (.Rows(intFilterOn).Cells("RptFieldID_FK").Value <> "0") Then If (.Rows(intFilterOn).Cells("Value/Choices").Text <> "//") Then If (.Rows(intFilterOn).Cells("Value/Choices").Text <> "--- Choose One ---") Then If (.Rows(intFilterOn).Cells("Value/Choices").Text.ToString.Length > 0) Then Dim strConditionIs As String = "=" Dim strWildCardIs As String = "" Select Case .Rows(intFilterOn).Cells("Conditional").Text Case "<", "<=", "<>", ">", ">=" strConditionIs = .Rows(intFilterOn).Cells("Conditional").Text Case "LIKE" strConditionIs = .Rows(intFilterOn).Cells("Conditional").Text strWildCardIs = "%" Case "BETWEEN" strConditionIs = .Rows(intFilterOn).Cells("Conditional").Text strDoBetween = "Y" Case Else strConditionIs = "=" End Select Dim strUseQuotes As String = "''" If (.Rows(intFilterOn).Cells("UseQuotes").Value = "False") Then strUseQuotes = "" End If Dim strUseField As String = " ''" If (.Rows(intFilterOn).Cells("WhereClauseSyntax").Value.ToString.Length > 0) Then strUseField = .Rows(intFilterOn).Cells("WhereClauseSyntax").Value Else strUseField = .Rows(intFilterOn).Cells("FieldIs").Value End If
Select Case strUseField Case "Order Status" Dim strItemIs As String = "" Dim intItemsSelected As Integer = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems.Count Label1.Text = "Status Items checked off = [" & intItemsSelected & "]" If (intItemsSelected > 0) Then Dim intItemsIDX As Integer = 0 While (intItemsIDX < intItemsSelected) strItemIs = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems(intItemsIDX).DisplayText msFilters(2) = msFilters(3) & "''" & strItemIs & "'', " intItemsIDX += 1 End While 'check for last COMA strItemIs = msFilters(2) strItemIs = StrReverse(StrReverse(strItemIs).Substring(2, (StrReverse(strItemIs).Length - 2))) msFilters(2) = strItemIs Else msFilters(2) = .Rows(intFilterOn).Cells("Value/Choices").Text Select Case msFilters(2) Case "", "--- Choose One ---" msFilters(2) = "" Case Else msFilters(2) = " ''" & msFilters(2) & "'' " End Select End If Case "Carrier" Dim strItemIs As String = "" Dim intItemsSelected As Integer = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems.Count Label2.Text = "Status Items checked off = [" & intItemsSelected & "]" If (intItemsSelected > 0) Then Dim intItemsIDX As Integer = 0 While (intItemsIDX < intItemsSelected) strItemIs = DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems(intItemsIDX).DisplayText msFilters(3) = msFilters(3) & "''" & strItemIs & "'', " intItemsIDX += 1 End While 'check for last COMA strItemIs = msFilters(3) strItemIs = StrReverse(StrReverse(strItemIs).Substring(2, (StrReverse(strItemIs).Length - 2))) msFilters(3) = strItemIs Else msFilters(3) = .Rows(intFilterOn).Cells("Value/Choices").Text Select Case msFilters(3) Case "", "--- Choose One ---" msFilters(3) = "" Case Else msFilters(3) = " ''" & msFilters(3) & "'' " End Select End If Case "Created Date" Dim dtDateToUse As Date dtDateToUse = .Rows(intFilterOn).Cells("Value/Choices").Text ' Used value but had wrong value in it!!! msFilters(0) = dtDateToUse dtDateToUse = .Rows(intFilterOn).Cells("End Range Value").Text intIDX += 1 msFilters(1) = dtDateToUse Case Else
End Select intIDX += 1
Else ' intIDX += 1 End If End If End If End If intFilterOn += 1 End While End With Catch ex As Exception
End Class
Hello Deasun,
Thanks for attached sample. I was able to reproduce your issue and after few hours of debuging, I`d like to inform you that mentioned issue is cause from the custom code. I was confuse from your scanrio where you are using InitializeRow event and override the selection from the drop down list. Just for example there are code:
e.Row.Cells("Value/Choices").Value = e.Row.Cells("InitValue").Text
Maybe you know that this event fired when row is initialized at the beggining and after each modification of the data in that row. By this way you always override the selection from your dropdown list
Also, I didn`t find where you set the mandatory properties for multiple selection like:
ultraComboEditor1.CheckedListSettings.CheckBoxStyle = CheckStyle.CheckBox;
ultraComboEditor1.CheckedListSettings.ItemCheckArea = ItemCheckArea.CheckBox;
ultraComboEditor1.CheckedListSettings.ListSeparator = ", ";
ultraComboEditor1.CheckedListSettings.EditorValueSource = EditorWithComboValueSource.CheckedItems;
Please note that without these settings you are not able to show in the grid`s cell, your selected dropdown items. That`s why, nevertheless of your selection in the drop down list, your grid`s cell will show only one item. So when you press "Read Filters" button you will get items count = 1, because the grid`s cell contains only one item. If you want to get correct item`s count of selected items, you should apply these properties. The grid`s cell should display each selected item from drop down menu with desired list separator.
Please choose one of the possible options to apply items to your UltraComboEditor. You could use DataSource or Items collection, but in both scenarios you should apply the properties above.
I`m not sure, but maybe there are a bug (in the sample), because nevertheless which item is choose from the drop down list, the grid`s cell alway shows the first item. Is it expected behavior ?
Please take a look at the attached video file for more information and let me know if you have any further questions.
PS. We realy will appreciate, if you create a simple sample next time. This will save our time for research and response. The same scenario could be reproduce it without database and half of the code in the sample.
Thanks and Regards
Did you restore the SQL Backup file to your local MS SQL server?
Then change the Connection string in the config file. named: Cstr_ToUse
Server name, User name & password.
It should work then for you.
I double checked the last project copy on a clean pc here and it works fine.
Yes the individual items have their checked state changed.
Its the Checkitems count property that is not being updated. It remain at a count of 1.
No matter how many you have actaully checked off.
Click begin to fill in the grid from the backup SQL DB.
Set the drop down for the 2nd and 3rd filter rows to whatever checked items you want.
Then click the Read check items btn. That will then attempt to rpt what the Checkeditems.count is returning in the two labels below the btn.
The project is about as simple as I can make it. :(
I have gotten around my problem by now looping thru the dropdown controls items and checking the checked state for each. Just a nusance, and would like to know why that property is not working.
Thanks for your replies.
Deasun.
So you are saying that the individual items property is changing from checked to not checked but the collection CheckedItems is not changing? I again cannot run your project, when I click on Begin the application just freezes. I am wondering if you could provide a simpler application without any extra code or functionality. I tried it on my own again and cannot reproduce this behavior.
Being playing around with the test project.
It still shows only 1 item is checked, but on checking the items individually,
I find the items are telling me which is checked and which is not.
I would have to loop thru each to find my checked items.
So whats not working is the;
DirectCast(uwGrid_RptFilters.Rows(intFilterOn).Cells("Value/Choices").EditorComponent, Infragistics.Win.UltraWinEditors.UltraComboEditor).CheckedItems.Count
Anyone any ideas?