ReadOnly MultiColumnComboBox

Using the 7.3 libraries, we've noticed that when a MultiColumnComboBox is ReadOnly, the SelectedValue can still change when the combo is dropped down and the user "selects" a row.
While the actual text doesn't change (good) and the user can drop down and look at values even though the control is ReadOnly (good) the SelectedValue seems to be changed when the user clicks on one of the rows.
The problem for us is that we're binding data to the SelectedValue. It seems that the underlying bound field gets changed even if we cancel out of a Validating event handler.
This seems to be different than in previous versions. Is it expected and is there anything we can do to prevent the SelectedValue from being changed when the control is ReadOnly?

This is reproduceable in the 7.3 dashboard samples.
Thanks,
Mark Atkinson

7 Replies

NR Nandakumar R Syncfusion Team December 7, 2009 06:11 AM UTC

Hi,

Thanks for your interest in Syncfusion Essential Studio. We are not able to see this issue in testing with 7.3.0.20 and 7.4.0.20. Can you please try the following sample and the video and let me know if I am missing anything in this.

[Video]
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=ComboTesting1596856124.zip

[Sample]
http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=MultiColumnComboboxTextApp-1614674302.zip

Regards,
Nanda


AD Administrator Syncfusion Team December 8, 2009 11:10 PM UTC

Here's an updated version of the MultiColumnComboBoxSampleControl.cs file from your sample.
The control is set to ReadOnly but the SelectedValue gets changed.
To reproduce, just select a new value from the drop down combo and then change focus to the multiline control below. Changing focus will fire the Validation events and a message box will display the controls SelectedValue.





MultiColumnComboBox_eb22f33b.zip


NR Nandakumar R Syncfusion Team December 9, 2009 07:21 AM UTC

Hi,

There is no .cs file in this. Can you please resend the project with the changes? Please zip the folder and send all the files, so that we can check the changes.

Regards,
Nanda


AD Administrator Syncfusion Team December 9, 2009 10:03 PM UTC

Sorry.
Here's another .zip file. I think all of the necessary files are there, but the only file that I made changes to was MultiColumnComboBoxSampleControl.cs

You need to invoke the Validate events to see the bug (e.g. lose focus from the control)



MultiColumnCombo_b0bc5626.zip


NR Nandakumar R Syncfusion Team December 10, 2009 04:26 AM UTC

Hi,

Thanks for the details.

The ReadOnly property is used to make the TextBox part ReadOnly. This will not affect the SelectedValue of the Control. However to get the same value in the validated event, you can use the TextBox value. This is the expected behaviour of the Control.


[C#]
void multiColumnBoundCombo_Validated(object sender, EventArgs e)
{
MessageBox.Show(multiColumnBoundCombo.Text.ToString());
}


Please try this and let me know if this helps.

Regards,
Nanda


AD Administrator Syncfusion Team December 10, 2009 05:02 PM UTC

Nanda,
The Text and the SelectedValue are two different properties and could have completely different values. The DisplayMember and ValueMember properties can be set to different fields and then the Text and SelectedValue would be different.

I'm not trying to get any value in the Validated event - I'm only using it to demonstrate where the bug is.

Something has changed in a recent Syncfusion release that has changed the behaviour of this control in such a way that it is no longer safe to bind it to a DataTable or DataView when the control's ReadOnly property is set to true.

Again, we're binding the SelectedValue property like this:
DataBindings.Add("SelectedValue", dataView, "Code", true);

...and then setting the DataSource to a related lookup/code table as in the sample.

But when a user drops down the panel and clicks on a row when the control is in a ReadOnly state, the data in the bound data source changes.

We've worked around this by not allowing the user to drop down the panel if the control is ReadOnly but it is not desirable. We'd like the old behaviour where the user can drop down the panel to see the values but not actually select one. Currently, if they click on a row in the drop down, the SelectedValue will change and, consequently, so will the live data that the SelectedValue is bound to.


NR Nandakumar R Syncfusion Team December 11, 2009 05:25 AM UTC

Hi,

Thanks for the details. I was able to see the difference in both the versions. I have reported this issue to our Developers and will get back to you in one business day with the timeline on fixing this issue.

Regards,
Nanda

Loader.
Up arrow icon