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

Using RadComboBox in a RadGrid with inline insert/update

3 Answers 302 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
cayates
Top achievements
Rank 1
cayates asked on 28 Jan 2009, 03:32 PM
I'm using a RadComboBox inside a RadGrid.  It appears I have to use a GridTemplateColumn because I want to use a custom skin for the drop down and I want to have a blank entry as the first item by default.  Is there a way to do that without using a GridTemplateColumn?

Anyhow, now that I'm using the GridTemplateColumn, I'm having a problem getting the in-line editing and inserting to work.  When I try to insert an item I get this error: "DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'Type'."  Editing an existing record works great.

Here is my code:

<telerik:GridTemplateColumn HeaderText="Type" DataField="Type" > 
                            <ItemTemplate> 
                                <%# Eval("Type.Name") %> 
                            </ItemTemplate> 
                            <EditItemTemplate> 
                                <telerik:RadComboBox ID="PropertyType" runat="server"  Width="250" Height="150" 
                                        DropDownWidth="300" ShowDropDownOnTextboxClick="true" MarkFirstMatch="true" 
                                        ShowToggleImage="false" AppendDataBoundItems="true"  
                                        DataSourceID="PropertyTypes" DataValueField="Id" DataTextField="Name" 
                                        AllowCustomText="false" SelectedValue='<%# Bind("Type.Id") %>'
                                    <Items> 
                                        <telerik:RadComboBoxItem Text="" /> 
                                    </Items> 
                                </telerik:RadComboBox> 
                            </EditItemTemplate> 
                        </telerik:GridTemplateColumn> 

Your demo "Combo In Grid" under "Application Scenarios" has this functionality except it only has in-line editing and not inserting or I would follow that.

Thanks,

Chris


3 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 02 Feb 2009, 07:40 AM
Hi cayates,

Please refer to this help article (under Setting predefined values for different column editors section) for more information about how to set default values when RadGrid's insert form is shown.

Greetings,
Rosen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mark
Top achievements
Rank 2
answered on 19 Sep 2009, 03:28 PM
Ever figure this out?  I'm facing the same error.  I didn't see much in the help article that applied to this situation.
0
Sebastian
Telerik team
answered on 22 Sep 2009, 11:29 AM
Hello MJ,

The article explains how to set predefined values for column editors to avoid such exceptions on init insert. You may also examine the content from this documentation topic related to the same subject.

Best regards,
Sebastian
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
ComboBox
Asked by
cayates
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Mark
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or