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.

ShowAddNewRow and Enums

Thread ID:





92895 Feb 10,2010 04:48 PM Feb 11,2010 07:11 AM WPF 1
Tags: GridControl
Francois Madore
Asked On February 10, 2010 04:48 PM


In the show AddNewRow, I have a cell which type is an enum "MyEnum" and I'd like the user to be able to choose an enum value in the cell. So is it possible by doing this?

lstNotes.VisibleColumns[2].ColumnStyle.ItemsSource = Enum.GetValues(typeof(NoteDestinationTypeEnum));

Is it supported by GridDataControl? Actuallyu when I fill the three cells, there is no item created.


ItemsSource="{Binding Source={StaticResource allNotes}, Path=Notes}">

Mohamed Suhaib Fahad A. [Syncfusion]
Replied On February 11, 2010 07:11 AM

Hi Francois,

Use the Model.QueryCellInfo event handler to change the CellType for the AddNewRow,

void Model_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
var gridStyle = e.Style as GridDataStyleInfo;
if (gridStyle.CellIdentity.TableCellType == GridDataTableCellType.AddNewRecordCell)
if (gridStyle.CellIdentity.Column != null && gridStyle.CellIdentity.Column.MappingName == "CustomerID")
gridStyle.CellType = "ComboBox";
e.Handled = true;

The VisibleColumn.ColumnStyle only applies to the Record cells. AddNewRow may require a separate property like AddNewRowStyle, Please let us know if you need any more details.



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.

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.