User (Old forums)MemberDecember 10, 2003 at 1:42 pmPost count: 23064
I have 2 columns in my grid to which i have attached the GridComboBox as the CellViewer and CellEditor…when i add a new record using insertion row i get the combo but rather than displaying the displaymember the cell displays the value…any idea what could be wrong…
sample code for first column
Dim cboZones As Xceed.Grid.Editors.GridComboBox = New GridComboBox
Dim gccNew As Column
gccNew = New Column(“DepotZone”, GetType(String))
gccNew.Width = 200
gccNew.CellEditor = cboZones
gccNew.CellViewer = cboZones
‘- The source for combo box is a dataview
.DataSource = dvZones
.DisplayMember = “ZoneDescr”
.ValueMember = “ZoneID”
same with the 2nd column…
Any idea what could be wrong ??
Imported from legacy forums. Posted by Sharad (had 3040 views)User (Old forums)MemberDecember 11, 2003 at 3:26 pmPost count: 23064
It could be that you are filtering your view somewhere else in the code. I usually create my DataTable or DataView inside the method used to attach it to the GridComboBox. That way, the DataTable or DataView is discarded (i.e. I can’t “mess up” the contents of the combobox).
And yes, the combobox keeps the data. This is true for all comboboxes.
If you have to filter the ComboBox for adding purposes, you *must* make sure to remove it as soon as possible. Otherwise, the grid cannot perform the lookup required and will display values instead.
Hope this helps.
Imported from legacy forums. Posted by MBonafe (had 357 views)User (Old forums)MemberDecember 12, 2003 at 4:12 amPost count: 23064
Thanks for your help. Quite honestly, i really donno what i did but fortunately i got it working. I was actually creating building the whole grid at runtime with a default groupby which was set to be invisible. So i started with a very complicated code. I got frustrated and so deleted the whole thing and started from scratch, bit by bit and got every piece of code working before i went ahead with the next. And to my joy it worked for me. The code is perfect now. I totally agree with what you said about the filtering of combobox, but it wasn’t the case in my code.
Thanks anyway for your help and suggestion. I look fwd to your help in future..
Enjoy the weekend !!
Imported from legacy forums. Posted by Sharad (had 4014 views)
- You must be logged in to reply to this topic.