We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ComboBox-cells give problems after upgrade version

Thread ID:





30432 Jun 17,2005 01:31 PM UTC Jun 20,2005 02:46 PM UTC WinForms 8
Tags: GridControl
Administrator [Syncfusion]
Asked On June 17, 2005 01:31 PM UTC

Hello, My ComboBox-cells give problems in my Grid after upgrading from version to version 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 ? With regards, Eric van Dinter

Administrator [Syncfusion]
Replied On June 17, 2005 03:12 PM UTC

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) ).

Administrator [Syncfusion]
Replied On June 20, 2005 10:06 AM UTC

Hello Clay, 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; break; } } When I add the code: GridControl[1,1].CellValueType = typeof(ContractItem); I still get the same result

Administrator [Syncfusion]
Replied On June 20, 2005 10:20 AM UTC

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.

Administrator [Syncfusion]
Replied On June 20, 2005 12:58 PM UTC

Hi Clay, 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. Eric

Administrator [Syncfusion]
Replied On June 20, 2005 12:59 PM UTC

Here''s the project

Administrator [Syncfusion]
Replied On June 20, 2005 01:01 PM UTC

TestComboBox_106.zip This time I hope ! ;-)

Administrator [Syncfusion]
Replied On June 20, 2005 02:18 PM UTC

Try setting the ValueMember to null. gridControl1[1,1].ValueMember = null; This will tell the gri dthat you want to use the item itself as teh value (and not a property of teh item).

Administrator [Syncfusion]
Replied On June 20, 2005 02:46 PM UTC

Yep ! That does the trick. Thanx for your support !! Eric


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon