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.

User editable derived CellModel

Thread ID:

Created:

Updated:

Platform:

Replies:

38018 Dec 4,2005 08:22 PM Dec 5,2005 02:22 PM Windows Forms 3
loading
Tags: GridControl
Adam K.
Asked On December 4, 2005 08:22 PM

i see the example in the samples for the GridLinkLable but none of the samples allow user editing If i have created a derived control (for example, i have an UpperCaseTextBox control which is a control that derives from Textbox and catched the keypress events and forces uppercase) can i use that as the grid cell ??

stanleyj [Syncfusion]
Replied On December 5, 2005 02:36 AM

Hi Adam, Refer the sample in windows\Grid.Windows\Samples\In Depth\CellButtons that we ship. When you derive the GridTextBoxCellModel and the GridTextBoxCellRenderer your cell will behave as a TextBox Control. In the LinkLabelCells sample, the LinlLabelCell is derived from the GridStaticCellModel and the GridStaticCellRenderer which implements a static CellType. You cold try OriginalTextBox as CellType instead of deriving private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) { if(e.RowIndex > 0 && e.ColIndex > 0) { e.Style.CellType = "OriginalTextBox"; e.Style.CharacterCasing = CharacterCasing.Upper; } } Let me know if this helps. Best regards, Stanley

Adam K.
Replied On December 5, 2005 11:46 AM

i am trying to do this generically so other people can use my celltype. Because of this i dont want to do the coding in the querycell event handlers. I want to create an isolated new CellType that i can have other use without having to code up their own event handlers . . >Hi Adam, > >Refer the sample in windows\Grid.Windows\Samples\In Depth\CellButtons that we ship. When you derive the GridTextBoxCellModel and the GridTextBoxCellRenderer your cell will behave as a TextBox Control. In the LinkLabelCells sample, the LinlLabelCell is derived from the GridStaticCellModel and the GridStaticCellRenderer which implements a static CellType. > > > >You cold try OriginalTextBox as CellType instead of deriving > > private void gridControl1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e) > { > if(e.RowIndex > 0 && e.ColIndex > 0) > { > e.Style.CellType = "OriginalTextBox"; > e.Style.CharacterCasing = CharacterCasing.Upper; > } > } > > >Let me know if this helps. > >Best regards, >Stanley

Administrator [Syncfusion]
Replied On December 5, 2005 02:22 PM

You can try creating a custom celltype to use your control. It will likely take some coding depending upone the exact functionality you want. Take a look at the Windows\Grid.Windows\Samples\CellTypes\Calendar sample. It shows teh steps needed to derive a custom scell type that wraps a MonthCalendar control. You coul dtry to do something similar with your control. Do a search for CellModels.Add in the Syncfusion\Essential Studio\3.3.0.0\Windows\Grid.Windows\Samples folder. It will show 18 or so different custom cell types that do various things if you need other samples. There is also a discusion of deriving cutom cellstyles in the User Guide that uses the LinkLabel cells as the basis for the discussion.

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.

;