Clay,
I found a problem in my code which probably causes this problem. After setting the data source for the column, in the row save event I''m calling select on that data source. the next time I query the value of this combo cell, I don''t get the value member, but the formatted text?!
I fixed it by creating a data set only for the combo.
But, I found another problem in the same matter:
I attached to this message your sample with minor changes:
1. The combo column type is changed to string(In my project I''m working with a typed data set and the field type is string)
2. On RowSave event I''m querying the cell value.
The results are, when selecting a value from the combo using the mouse, and moving to the next record, the "ValueMember" is returned as a string. When selecting the "ValueMember" using the keyboard (select with arrows and enter) and after that move with the keyboard to the next record, the value is retrived as an int32?! Why is that?
Thanks,
Gil
>I added this code at the bottom of the Form_Load in the sample instead of using the InternalColumn to get the style, and it still seems to work.
>
>GridHierarchyLevel hlRoot = gridDataBoundGrid1.Binder.RootHierarchyLevel;
>hlRoot.LayoutColumns(new string[] { "Col2","Col0","combo"});
>GridStyleInfo style = hlRoot.GridBoundColumns["combo"].StyleInfo;
>style.CellType = "ComboBox";
>style.DataSource = dt;
>style.DisplayMember = "displayMem";
>style.ValueMember = "valueMem";
>
>
>Exactly what is the type of gdbg1? If you are getting that no indexer error, then I suspect it is typed as a GridControlBase. You would need to either cast it as a GridDataBoundGrid to use the indexer, or use gdbg1.Model and index that.
>
>But I do not think it will make a difference as using GetCellStyleInfo worked for me in the sample.
>
>Exactly where are you trying to use this code? (You reference e.RowIndex which suggests it might be in some event. This might be playing a role in the problem depending upon the event.)
>
>If you can post a sample showing the problem, we can try to spot something here.
ReplayComboBoxGDBG_7714.zip