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.
Syncfusion Feedback

Problem with refreshing a dropdown column in a datagrid

Thread ID:

Created:

Updated:

Platform:

Replies:

53308 Dec 12,2006 05:58 AM UTC Dec 14,2006 11:25 AM UTC Windows Forms 17
loading
Tags: GridControl
poornima
Asked On December 12, 2006 05:58 AM UTC

I have two columns in a datagrid both of which have dropdown choicelist ... based on one columns selection i populate the other dropdown..

If suppose a value is selected in the first column and the selected value doesn't have related values for the second dropdown, then i need to clear the choicelist as well as the text value of the second dropdown..

I am able to clear the choicelist as well as the text value...but the application hangs after this... I am not able to move the focus out of the second column..only after pressing escape i am able to recover..any clue on this..

I populate the second dropdown in 'CurrentCellCloseDropDown Event'

Administrator [Syncfusion]
Replied On December 12, 2006 06:17 AM UTC

Hi Poornima,

Here is a KB article that discuss with the simillar issue.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=102

Best Regards,
Haneef

poornima
Replied On December 12, 2006 09:18 AM UTC


Hi,

In the given sample, the choicelist is refreshed in the QueryCellInfo Event which keeps on firing even if specific conditions are specified. My application seems to hang since the event fires continuously. Is there any other solution for the issue.


Regards
Poornima S

>Hi Poornima,

Here is a KB article that discuss with the simillar issue.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=102

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On December 12, 2006 11:35 AM UTC

Hi Poornima,

The attached sample shows you How to change the datasource of the one combobox cell depending upon the value selected in another combobox in a grid. It uses the CurrentCellShowingDropDown event to populate the datasource of the combobox cell dynamically.It also implements the CurrentCellCloseDropDown for clearing the datasource of the cell. Please refer to the attached sample for more details.

Sample : ComboBoxDatasource.zip

Best Regards,
Haneef

poornima
Replied On December 13, 2006 05:43 AM UTC

Hi,

The previous sample seems to work. But the second dropdown column is editable which allows users to type in some values, so is there any way to prevent users from keying in values.

Regards
Poornima S

Administrator [Syncfusion]
Replied On December 13, 2006 06:03 AM UTC

Hi Poornima,
Please try this code snippet and let us know if this helps.

private void Form1_Load(object sender, System.EventArgs e)
{
this.gridDataBoundGrid1.Binder.InternalColumns["Col1"].StyleInfo.ReadOnly = true;
}

Best Regards,
Jeba.

poornima
Replied On December 13, 2006 06:10 AM UTC

Hi,

I tried using it but the selected value in the dropdown doesn't appear in the grid. It clears of immediately.

Regards
Poornima S

Administrator [Syncfusion]
Replied On December 13, 2006 06:46 AM UTC

Hi Poornima,
Please try this code snippet and let us know if this helps.

private void Form1_Load(object sender, System.EventArgs e)
{
this.gridDataBoundGrid1.Binder.InternalColumns["Col1"].StyleInfo.ExclusiveChoiceList=true;
}

Best Regards,
Jeba.

poornima
Replied On December 13, 2006 06:58 AM UTC

Hi,

Find attached code. The problem with giving ExclusiveChoiceList to true.

Replicate the issue by:

1. Select value "One" from the second column of the grid.
2. Select a value "A" from the third column of the same row.
3. Now select other value "Two" from the second column of the grid.
4. Move focus to third column now.

The system hangs. Let me know what else can be done for the issue.

Regards
Poornima S

poornima
Replied On December 13, 2006 07:04 AM UTC

Sorry couldn't attach the code. Please modify the sample that is earlier provided by u specifying ExclusiveChoicelist to true and follow the steps specified in the above reply

Administrator [Syncfusion]
Replied On December 13, 2006 07:22 AM UTC

Hi Poornima,
I tried to reproduce the hanging state. But, I was not able to reproduce the situation. Here is the tested video clip:
VideoClip.zip.
Could you please give me some more information regarding how to implement this issue in the above sample. I would really appreciate it if you could provide us a sample that exhibits this behavior. We will try analyzing it here. Also please let me know your Syncfusion version details.
Best Regards,
Jeba.

poornima
Replied On December 13, 2006 09:01 AM UTC

Hi,

I tried to set the ExclusiveChoiceList to true in the QueryCellInfo event. When i commented the code i was able to work with.

In te previous sent code, in the second dropdown users should not be able to type in any value.

How do i achieve this??


Regards
Poornima S

Administrator [Syncfusion]
Replied On December 13, 2006 09:53 AM UTC

Hi Poornima,
Here is the modified sample:
ComboBoxDatasource_3b042a36.zip
Best Regards,
Jeba.

poornima
Replied On December 13, 2006 10:29 AM UTC

Hi,

In the above sample u sent me just follow the steps i have mentioned earlier [ For reference: Replicate the issue By ]

U will find that at the end, the application hangs

Regards
Poornima S

poornima
Replied On December 14, 2006 04:22 AM UTC

Hi,


Can you please look into the above issue. Its quite urgent.

Regards
Poornima S

Administrator [Syncfusion]
Replied On December 14, 2006 09:51 AM UTC

Hi Newmancroos,

You can handle the CurrentCellCloseDropDown event and call Binder.EndEdit() method to save the changes to the underlying datasource. Here is a code snippet

//Cancel the SelectedIndex changes when double click on the cell.
GridComboBoxCellModel cm = this.gridDataBoundGrid1.Model.CellModels["ComboBox"] as GridComboBoxCellModel;
cm.AllowDoubleClickChangeSelectedIndex = false;

private void gridDataBoundGrid1_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(cc.ColIndex == 2)
this.gridDataBoundGrid1.Binder.EndEdit();
}

Here is a modified sample.
ModifiedComboBoxDatasource.zip

Best Regards,
Haneef

Administrator [Syncfusion]
Replied On December 14, 2006 09:55 AM UTC

Hi Poornima,

My apologies for addressing to the wrong person, it was meant for you.

You can handle the CurrentCellCloseDropDown event and call Binder.EndEdit() method to save the changes to the underlying datasource. Here is a code snippet

//Cancel the SelectedIndex changes when double click on the cell.
GridComboBoxCellModel cm = this.gridDataBoundGrid1.Model.CellModels["ComboBox"] as GridComboBoxCellModel;
cm.AllowDoubleClickChangeSelectedIndex = false;

private void gridDataBoundGrid1_CurrentCellCloseDropDown(object sender, Syncfusion.Windows.Forms.PopupClosedEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if(cc.ColIndex == 2)
this.gridDataBoundGrid1.Binder.EndEdit();
}

Here is a modified sample.
ModifiedComboBoxDatasource.zip

Best Regards,
Haneef

poornima
Replied On December 14, 2006 11:25 AM UTC

Thank you so much. It has been a great help.

Regards
Poornima S

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.

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

;