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

ComboBox in every cell of a particular column

Thread ID:





117122 Aug 18,2014 07:05 AM UTC Aug 26,2014 12:25 PM UTC WPF 1
Tags: SpreadsheetControl(Classic)
Asked On August 18, 2014 07:05 AM UTC

Hi ,

I've a list of command items.
For eg:

            List<CommandItem> list = new List<CommandItem>();

            list.Add(new CommandItem() { Value = "delete", Name = "Delete" });
            list.Add(new CommandItem() { Value = "remove", Name = "Remove" });
            list.Add(new CommandItem() { Value = "ignore", Name = "Ignore" });
I'm dragging and dropping some data into the spreadsheet control. I want all the cells of first column to contain Combo box showing these command items.

I did the same thing in Grid like following
            GridDataColumnStyle columnStyle = new GridDataColumnStyle();
            columnStyle.CellType = "ComboBox";
            columnStyle.ItemsSource = list;
            columnStyle.DropDownStyle = GridDropDownStyle.AutoComplete;
            columnStyle.DisplayMember = "Name";
            columnStyle.ValueMember = "Value";
            GridDataControl gridData = Application.Current.MainWindow.FindName("dataGrid") as GridDataControl;
            DataTable dt =  new DataTable();
            DataColumn dc;
            dc = dt.Columns.Add( "Command");
            gridData.VisibleColumns.Add(new GridDataVisibleColumn() { ColumnStyle = columnStyle, HeaderText = dc.ColumnName, MappingName = dc.ColumnName });

Now I want to do the same thing in SpreadsheetControl where I'm importing data from a datatable. But I'm having trouble in getting the Combo box. How do i set the column style to combo box in spreadsheetControl.

Kanimozhi Bharathi [Syncfusion]
Replied On August 26, 2014 12:25 PM UTC

Hi Stephly,


Apologize for the delay.


We have analysed your query. You can set all the cells of first column to  be Combo box by hooking  QueryCellInfo event in the WorkBookLoaded event  and set the cell type as combo box  like the below code snippet.


Code Snippet:



void grid_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)



if (e.Cell.ColumnIndex == 1)


    e.Style.CellType = "ComboBox";

    e.Style.ItemsSource = list;






we have also prepared the sample based on your requirement and please find the sample in the below location



Please let us know if you need any further assistance.



Kanimozhi B

Attachment: Import_Data_table(1)_7a72b0bb.zip


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