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

[Solved] GridViewComboBoxColumn only in insert mode

6 Answers 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michele
Top achievements
Rank 2
Michele asked on 30 Sep 2010, 09:17 AM
Hello Telerik,
it's possible to have the combobox only in the InsertRow mode and as a textbox in normal and edit mode?
Thanks

Paolo

6 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 30 Sep 2010, 09:26 AM
Hello Paolo,

It is not internally supported, but with a small hack , it can be done.

You may place a small user control in the CellEditTemplate. In the code behind , when loading the user control you may check if the parent is GridViewRow or GridViewNewRow and conditionally show/hide the editor.

Let me know if you need sample code on that .

Kind regards,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michele
Top achievements
Rank 2
answered on 30 Sep 2010, 10:21 AM
Hello Pavel,
a sample would be really appreciated.... a usecontrol with a radcombobox you mean?
Thanks

Paolo
0
Michele
Top achievements
Rank 2
answered on 30 Sep 2010, 05:07 PM
I've not been able to create it, can you please provide me a sample?
Thanks

Paolo
0
Pavel Pavlov
Telerik team
answered on 01 Oct 2010, 04:19 PM
Hello Paolo,

In the sample attached , i have tried to resemble the scenario -

When the user presses Insert - a new row appears with a combo editor,
When a regular row is edited - a textbox editor is shown .

In case you find further troubles with this, just let me know.

Greetings,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Michele
Top achievements
Rank 2
answered on 01 Oct 2010, 05:01 PM
ok I only need to pass the Combobox values from the main control to the usercontrol then I'm ok... (otherwise I've to call each time a wcf service to retrieve the data)

Thanks

Paolo
0
Pavel Pavlov
Telerik team
answered on 04 Oct 2010, 11:42 AM
Hi Paolo,

You can use binding to pass the ItemsSource to the combo inside the user control.

For this you will need.

1. Expose an ItemsSource property on the user control wrapping the combo ( this property should be bound to the items source of the internal combo

2. In the CellEditTemplate , you may then bind the new property to the list of items for the combo.

3. To be able to use binding , you will need to expose the list as a static resource , and then in the cell edit template use syntax like :

ItemsSource= {Binding , Soruce={StaticResource  ......

Let me know if you need me to extend  the example to cover this as well.

Best wishes,
Pavel Pavlov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
Michele
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Michele
Top achievements
Rank 2
Share this question
or