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. Image for the cookie policy date

combobox inside grid issue

Hi All,
I have one Syncfusion.Windows.Forms.Grid.GridDataBoundGrid named "dgrdReportCode" which has two columns and in one of that I am binding one combobox(by making its CellType as ComboBox).
Actually the data to which the grid is bound is a subset of the data that is shown in the combobox.Say the datatable that the combobox is bound to is having data (e.g "Text1","Text2","Text3") in the column that is set as comboboxe's DisplayMember.

Now initially nothing will be saved in database.So,the user will select one item say "Text1" from the combobox.Note that the user cannot edit the text of the combobox.That's why I have coded this line

entityStyle1.DropDownStyle = GridDropDownStyle.Exclusive;

Now after I save the screen and reopen the same screen I'll get a datatable which will contain the saved values(which is essentially a subset of the combobox values) and this table is actually bound to the grid.

Earlier I did not face any problem to show the saved value("Text1") as selected in the combobox because then I was not using this line of code

entityStyle1.DropDownStyle = GridDropDownStyle.Exclusive;

Now my requirement has changed and I need to use the above mentioned line of code because now user should not be able to enter anything in the combobox by pressing keys.

Now the data is being bound to the combobox("Text1","Text2","Text3") but the selected text(here say "Text1") is not being shown.It is shown as blank.

Can anybody please help me out in this?

I am providing the code snippent also.

GridBoundColumn gbcEntity1 = this.dgrdReportCode.Binder.
InternalColumns["CORE_SYSTEM_MAPPING"];
gbcEntity1.HeaderText = "SYSTEM";
GridStyleInfo entityStyle1 = gbcEntity1.StyleInfo;
entityStyle1.CellType = Constants.COMBOBOX;
entityStyle1.DropDownStyle = GridDropDownStyle.Exclusive;
entityStyle1.DataSource = dsParty.Tables[14];
entityStyle1.DisplayMember = dsParty.Tables[14].Columns
["DESCRIPTION"].ColumnName;
entityStyle1.ValueMember = dsParty.Tables[14].Columns["MAPPING_CODE_VALUE"].ColumnName;
entityStyle1.CellValue = "CAMS Party Alias";

Thanks in advance!
Subrta


1 Reply

JJ Jisha Joy Syncfusion Team March 5, 2009 09:01 AM UTC

Hi Subrata,

Thank you for using Syncfusion Products.

I have tested the issue in the following sample. But i am afraid I was not able to see the issue as you mentioned. Please see the same and if the issue still exists, then reproduce the issue in the below sample and send us the modified sample. So that we could analyze the issue here.

http://files.syncfusion.com/support/Grid.Windows/GDBGComboBoxIssue.zip

Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon