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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ShowAddNewRow and Enums

Thread ID:

Created:

Updated:

Platform:

Replies:

92895 Feb 10,2010 09:48 PM UTC Feb 11,2010 12:11 PM UTC WPF 1
loading
Tags: GridControl
Francois Madore
Asked On February 10, 2010 09:48 PM UTC

Hi,

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.

Thanks!

AutoPopulateRelations="False"
VisualStyle="DefaultOffice2007Blue"
ItemsSource="{Binding Source={StaticResource allNotes}, Path=Notes}">













Mohamed Suhaib Fahad A. [Syncfusion]
Replied On February 11, 2010 12:11 PM UTC

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.

-Fahad

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

;