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.

GridGroupingControl CellType

Thread ID:

Created:

Platform:

Replies:

33787 Aug 26,2005 01:55 AM General Discussion 0
loading
Tags: General Discussion
Dmitry
Asked On August 26, 2005 01:55 AM

Hi. I have a text column in my DataTable and I need display this column values different ways depend upon a correspond values in another column. So I try this: private void gridGroupingControl1_QueryCellStyleInfo( object sender, GridTableCellStyleInfoEventArgs e ) { if ( e.TableCellIdentity.Column != null && e.TableCellIdentity.DisplayElement.Kind == DisplayElementKind.Record && e.TableCellIdentity.Column.Name == "Value" ) { DataRowView row = (DataRowView)e.TableCellIdentity.DisplayElement.GetData(); switch ( (Byte)row["ValueType"] ) { case 2 : e.Style.CellValueType = typeof(DateTime); e.Style.CellType = "MonthCalendar"; break; case 3 : e.Style.CellValueType = typeof(int); e.Style.CellType = "ComboBox"; e.Style.ExclusiveChoiceList = true; e.Style.DisplayMember = "Text"; e.Style.ValueMember = "Id"; e.Style.DataSource = MyListItem.GetDataSource(); break; default: e.Style.CellType = "TextBox"; break; } e.Handled = true; } } It''s work normal when I click in combo-cell (case 3). But when I leave my combo-cell it displays empty value.

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.

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.

;