This is a migrated thread and some comments may be shown as answers.

Change CellEditor before edit mode

5 Answers 70 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Rogério
Top achievements
Rank 1
Rogério asked on 01 Apr 2009, 02:46 PM
Hello,

I'm using GridView and I need to change CellEditor for each cell! I could have different CellEditor on the same column!
My ideia was to change CellEditor when changing to edit mode.

Could you tell me what's the best way to do it?

Thanks.

Regards,
Rogério

5 Answers, 1 is accepted

Sort by
0
Accepted
Nedyalko Nikolov
Telerik team
answered on 02 Apr 2009, 09:21 AM
Hi Rogério,

Unfortunately cell editor is connected to the GridViewDataColumn object, it means that every cell from a column will have same editor.

As a workaround you can make your custom editor to act different depending from data (as value).
I'm attaching a running example as a reference how to create custom CellStyle with custom ComboBox editor which allows showing some lookup data.

Greetings,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Rogério
Top achievements
Rank 1
answered on 02 Apr 2009, 09:54 AM
Hi,

Thanks for the quick reply and sample application! Your proposed workaround could be a solution for now, but it would be very helpful if you could provide, on future releases, the possibility to change cell editor before edit mode.

Regards,
Rogério
0
Nedyalko Nikolov
Telerik team
answered on 03 Apr 2009, 07:36 AM
Hello Rogério,

Thank you for the valuable feedback.

This indeed is a good idea and we of course will consider providing such functionality for future releases.

Best wishes,
Nedyalko Nikolov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Rogério
Top achievements
Rank 1
answered on 07 May 2009, 10:25 PM
Hello again,

I'm trying to implement some custom GridViewCellEditors but I'm having some problem after defining more then one!

I've implemented two custom editors. Following your example, when I try to access EditorElement on OnApplyTemplate override I always get a null value except for the first editor!!

I've defined the respective style on Generic.xaml!

Can you help me on this?

Thanks.

Best Regards,
Rogério
0
Rogério
Top achievements
Rank 1
answered on 08 May 2009, 09:33 AM
Hello,

I've found the problem!! :)

My fault!!

Thanks anyway!

Best Regards,
Rogério
Tags
GridView
Asked by
Rogério
Top achievements
Rank 1
Answers by
Nedyalko Nikolov
Telerik team
Rogério
Top achievements
Rank 1
Share this question
or