User (Old forums)MemberFebruary 10, 2010 at 8:59 amPost count: 23064
I have two
an unbound column which contains a ComboBox with a selection of status type
a bound, invisible column that contains the StatusID (an integer value)
I am trying
to change the StatusID value based on the Status value the user changes via a
What I have
so far is:
the following class:
Public Class ListItem
Public ItemText As String ‘ what is
Public ItemData As Integer ‘ associated data
Public Overrides Function ToString() As
by combo box editor:
Private TestComboBox As New WinComboBox()
As New ListItem
I added data to the combo box:
ListBoxData = New
ListBoxData.ItemText = “Item 1”
ListBoxData.ItemData = 1
ListBoxData = New
ListBoxData.ItemText = “Item 2”
ListBoxData.ItemData = 2
I created the
columns, attached the combo box to the column, and added the handler
= New ComboBoxEditor(TestComboBox)
The “Status” cell
updates as it should, but I can not figure how to update the “StatusID” cell. The following does not work:
Private Sub Status_LeavingEdit(ByVal
sender As Object,
ByVal e As
Dim Cell As Cell = CType(sender,
ListBoxData = CType(Cell.Value,
Can anyone help?
Imported from legacy forums. Posted by Morgan (had 2378 views)Xceed SupportMemberFebruary 11, 2010 at 2:20 pmPost count: 5658
You could implement the ValueChanged event on the cells of the “Status” unbound column. Once the value has changed, a delegate method will be called where you could access the “StatusID” field value of the ParentRow and modify as desired.
Dim Cell As Cell = CType(sender, Cell)
Cell.ParentRow.Cells(“StatusID”).Value =”New Value”
Imported from legacy forums. Posted by Mohamed [Xceed] (had 396 views)User (Old forums)MemberFebruary 12, 2010 at 8:00 amPost count: 23064
My problem is that “New Value” needs to come from the TestComboBox that the user used to change the “Status” description cell. I don’t know how to get the associated data (ItemData) from the combo box the user used to select the “Status”.
Dim Cell As
Cell = CType(sender,
Cell.ParentRow.Cells(“StatusID”).value = ListBoxData.ItemData
The only value that matters is the StatusID (which is a number). The Status cell is used to provide the user with a description of what this StatusID number represents.
Imported from legacy forums. Posted by Morgan (had 454 views)User (Old forums)MemberApril 4, 2010 at 8:35 amPost count: 23064
Try working on Combobox viewer and editor component, they will simplify your headache for maintaining status description and ID columns on the grid. Moreover its easy just with 4 lines of code, you get your things worked out.
Hope below few lines help you understand.
Dim CBOViewer_Company = New ComboBoxViewer(dsMasters, “Mst_Company”, “AutoID”, “%CName%”)
Dim CBOEditor_Company = New ComboBoxEditor(dsMasters, “Mst_Company”, “AutoID”, “%CName%”)
“CompanyID”).CellViewerManager = CBOViewer_Company
“CompanyID”).CellEditorManager = CBOEditor_Company
“CompanyID”).Title = “Company”
CBOEditor_Company.TemplateControl.SearchMode = Xceed.Editors.
New Size(250, 150)
Imported from legacy forums. Posted by Credits (had 1110 views)
- You must be logged in to reply to this topic.