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

Binding option list to grid cells using context menu

Thread ID:





92631 Jan 27,2010 03:30 PM UTC Feb 1,2010 02:31 PM UTC ASP.NET Web Forms (Classic) 1
Tags: GridGroupingControl
Asked On January 27, 2010 03:30 PM UTC

Hi ,
We are planning to use sync fusion gird control for one of our major project using WPF .Our requirement is to be able to display excel sheet
Like control to user where they can enter only predefined vales like ‘yes’, ‘No’,’Good’,’bad’ etc in the 2nd column of the grid control .If they try to enter ‘yep’ instead of ‘yes’ we should not let them enter ‘p’ in yep and cell value should get clear when they move to next cell and also we should let them enter special character Like ‘Ctrl D’ for delete.
Here is the code I am using which is partial working .But not sure how to handle special case character like ‘Ctrl D’ and also like to know how to bind context menu to specific column dynamically at runtime…
I am attaching the screen short of the existing where we trying to re-write using sync fusion gird control using WPF.
Any sample project will be greatly appreciated.

private void grid_CurrentCellEditingComplete(object sender, SyncfusionRoutedEventArgs e)
ExcelGridControl grid = sender as ExcelGridControl;

if (grid != null)
{ GridCurrentCell cc = grid.CurrentCell;
GridStyleInfo style = grid.Model[cc.RowIndex,c.ColumnIndex];

//set the background style
style.Background = new SolidColorBrush(Colors.White);

//check if any constraints were specified and if valid values were entered
if (style.ChoiceList != null && style.ChoiceList.Count > 0 && style.CellValue != null)
if (!style.ChoiceList.Contains(style.CellValue.ToString()))
style.CellValue = string.Empty;
style.Background = new SolidColorBrush(Colors.Yellow);

object value = cc.Renderer.ControlValue;

// Binding to cell code
this.dgMain.Model[3, 2].ChoiceList = items;

//create option list
StringCollection items = new StringCollection();


Dhinesh Pandiyan M [Syncfusion]
Replied On February 1, 2010 02:31 PM UTC

Hi Sireesha,

Thanks for using Syncfusion products.

This problem has been resolved and updated in the incident #64116.

Please let us know if have any other questions.

With Regards,
Dhinesh Pandiyan


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

This page will automatically be redirected to the 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