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.
Thanks.