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.
Unfortunately, activation email could not send to your email. Please try again.

ComboBox celltype

Thread ID:

Created:

Updated:

Platform:

Replies:

2063 Dec 12,2002 12:55 PM Dec 13,2002 10:26 AM Windows Forms 5
loading
Tags: GridControl
Jeff Walstrom
Asked On December 12, 2002 12:55 PM

PROBLEM #1 I am using a grid control with a celltype of combobox with the property of ExclusiveChoiceList = False. The problem occurs when the user types a new value into the cell when the cell loses focus the text becomes drop shadowed. PROBLEM #@ I would also like to know how to retreive the comboboxes displayed text instead of the cellvalue used in databinding (.Text and .CellValue return the same value). Any help would be great. Jeff Walstrom

Administrator [Syncfusion]
Replied On December 12, 2002 01:17 PM

> PROBLEM #1 > I am using a grid control with a celltype of combobox with the property of ExclusiveChoiceList = False. The problem occurs when the user types a new value into the cell when the cell loses focus the text becomes drop shadowed. What is drop shadowed? Do you mean it is drawn like disabled text? I guess you have a related data source with DisplayMember and ValueMember set. Now, when you type in a new value then there is no corresponding value to be looked up in the related table. One idea would be to check if the value is in the related table and if not, manually add it. A good place to do this would be a CurrentCellAcceptedChanges event handler. > > PROBLEM #@ > I would also like to know how to retreive the comboboxes displayed text instead of the cellvalue used in databinding (.Text and .CellValue return the same value). > Use .FormattedText instead. Stefan

Jeff Walstrom
Replied On December 12, 2002 02:11 PM

> > PROBLEM #1 > > I am using a grid control with a celltype of combobox with the property of ExclusiveChoiceList = False. The problem occurs when the user types a new value into the cell when the cell loses focus the text becomes drop shadowed. > > What is drop shadowed? Do you mean it is drawn like disabled text? > > I guess you have a related data source with DisplayMember and ValueMember set. Now, when you type in a new value then there is no corresponding value to be looked up in the related table. > > One idea would be to check if the value is in the related table and if not, manually add it. A good place to do this would be a CurrentCellAcceptedChanges event handler. > > > > > > PROBLEM #@ > > I would also like to know how to retreive the comboboxes displayed text instead of the cellvalue used in databinding (.Text and .CellValue return the same value). > > > > Use .FormattedText instead. > > Stefan > > Is there another way to have the text not disabled/dropshadowed wihout adding it to the underlying comboboxes datasource?

Administrator [Syncfusion]
Replied On December 12, 2002 03:52 PM

> Is there another way to have the text not disabled/dropshadowed wihout adding it to the underlying comboboxes datasource? > I can't actually think of any reason why it should be drawn disabled. The default behavior of a combobox is that is resolves the value to a displaymember if it finds the value in the underlying data source. Otherwise it just goes ahead and displays the value. That means you can enter any value and it should be displayed with the same font. I checked our samples but could not see such behavior that you get. You might check if any of your event handlers throws an exception. See the "Debug|Exceptions" menu in Visual Studio Environment. If you continue to have problems, I recommend you open a support incident with direct-trac and attach a small sample that demonstrates the problem. Best would be to take one of our samples and modify it. Stefan

Jeff Walstrom
Replied On December 13, 2002 08:56 AM

> > Is there another way to have the text not disabled/dropshadowed wihout adding it to the underlying comboboxes datasource? > > > > I can't actually think of any reason why it should be drawn disabled. > > The default behavior of a combobox is that is resolves the value to a displaymember if it finds the value in the underlying data source. Otherwise it just goes ahead and displays the value. That means you can enter any value and it should be displayed with the same font. > > I checked our samples but could not see such behavior that you get. > > You might check if any of your event handlers throws an exception. See the "Debug|Exceptions" menu in Visual Studio Environment. > > If you continue to have problems, I recommend you open a support incident with direct-trac and attach a small sample that demonstrates the problem. Best would be to take one of our samples and modify it. > > Stefan The drop shadow only occurs when alpha characters are entered in the cell but does not occur when numeric values are entered. the combobox contains both numeric and alpha characters. Could this be a problem becuase when you hand enter the values it puts the alpha character as the cellvalue(key) when the underlying datasources cellvalue(key) is always a numeric value. Jeff

Administrator [Syncfusion]
Replied On December 13, 2002 10:26 AM

> > The drop shadow only occurs when alpha characters are entered in the cell but does not occur when numeric values are entered. the combobox contains both numeric and alpha characters. Could this be a problem becuase when you hand enter the values it puts the alpha character as the cellvalue(key) when the underlying datasources cellvalue(key) is always a numeric value. > > Jeff > That explains it. The problem is the grid can't save the string value in a numeric column because the underlying datasource will throw an exception when you try to store a string instead. What I would suggest then is to handle the CurrentCellValidated event. This event is called just before the grid saves the string into the underlying datasource. At that point you either add a value in the datatable that is displayed or generate a unique id and store the string in a hashtable. I can't tell right now how difficult this is without trying myself, but if you are ok with such a solution I can try to come up with more concrete steps how to add a string value when it is not found in the combobox. Stefan

CONFIRMATION

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.

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.

;