My ComboBox-cells give problems in my Grid after upgrading from version 184.108.40.206 to version 220.127.116.11
I have 2 problems with my ComboBox cells in a grid after the upgrade:
1 The value a cell shows is not anymore what I expected but the formname + ValueMemberName.
The font that''s used is also a little bit strange (shaded ?).
2 clicking on a cell doesn''t show the list of possible values
This is the code I use for defining the cell:
GridControl[1,1].CellType = "ComboBox";
GridControl[1,1].DropDownStyle = GridDropDownStyle.Exclusive;
GridControl[1,1].Trimming = System.Drawing.StringTrimming.EllipsisCharacter;
GridControl[1,1].DataSource = lDataSource;
GridControl[1,1].DisplayMember = "Contract";
GridControl[1,1].ValueMember = "ContractItem";
The property Contract of a ContractItem returns a string;
lDataSource is an ArrayList of ContractItem-objects
Can someone tell me what I do wrong ?
Eric van Dinter
ADAdministrator Syncfusion Team June 17, 2005 10:12 AM
I suspect there may be a exception being thrown. Just your output window when you run in debug. Are you setting the initial values in cell 1,1 to be valid ContractItem values, (ie, have the same type). For example, if ContractItem is an integer, then are you setting grid[1,1].Cellvalue to an iteger (maybe grid[1,1].CellValueType = typeof(int) ).
ADAdministrator Syncfusion Team June 20, 2005 05:06 AM
I don''t get the impression that an exception occurred. How can I be sure of it ?
I set the value of the cell with the following code:
foreach(ContractItem lItem in lDataSource)
if (lItem.Contract == lContract)
GridControl[1,1].CellValue = lItem;
When I add the code:
GridControl[1,1].CellValueType = typeof(ContractItem);
I still get the same result
ADAdministrator Syncfusion Team June 20, 2005 05:20 AM
You can run your application in debug mode with the debugger set to break on exceptions. (Use the Debug/Exceptions menu item. In the dialog, click Common Language Runtime exceptions in the top box, and then click the Break into the Debugger option underneath it.)
Is the Contract value a string, or is it an object you have defined through a class. If if is an object, did you override ToString to display what you want seen here?
If you can upload a sample project showingthe porblem, we can try to debug it here.
ADAdministrator Syncfusion Team June 20, 2005 07:58 AM
I added the ToString method and now the right text is shown.
I thought that it would be set by DisplayMember ?
But I still have the problem that font is strange and clicking does not have any effect.
So hereby I send you a little project showing the problem.
ADAdministrator Syncfusion Team June 20, 2005 07:59 AM
Here''s the project
ADAdministrator Syncfusion Team June 20, 2005 08:01 AM