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

[Solved] RadCombo in RadGrid

6 Answers 69 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.
Scott Nolen
Top achievements
Rank 1
Scott Nolen asked on 15 Sep 2010, 02:42 PM
I am using the new silverlight 4 controls. I have a RadCombo in a column of the RadGrid. It works flawlessly as long as i choose an item from the dropdown of the combo, BUT my end users also need to be able to simply type in a value without selecting from the combo. How can i achieve this behavior? Below is how the combo is defined within the grid.


 

 

 

<telerikGridView:GridViewDataColumn Header="Email And/Or Fax Address" HeaderTextAlignment="Center" DataMemberBinding="{Binding emailaddress, Mode=TwoWay}" TextAlignment="Left" >

 

 

 

 

<telerikGridView:GridViewDataColumn.CellTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<TextBlock Text="{Binding emailaddress}" />

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikGridView:GridViewDataColumn.CellTemplate>

 

 

 

 

<telerikGridView:GridViewDataColumn.CellEditTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<telerikInput:RadComboBox x:Name="rcboEmailAddress"

 

 

 

DropDownOpened="rcboEmailAddress_DropDownOpened"

 

 

 

SelectionChanged="rcboEmailAddress_SelectionChanged"

 

 

 

IsEditable="True"

 

 

 

KeyDown="rcboEmailAddress_KeyDown"

 

 

 

ItemsSource="{StaticResource AddressList}"

 

 

 

telerik:TextSearch.TextPath="EmailAddress"

 

 

 

SelectedValue="{Binding emailaddress, Mode=TwoWay}"

 

 

 

SelectedValuePath="EmailAddress"

 

 

 

MaxDropDownHeight="100"

 

 

 

 

GotFocus="rcboEmailAddress_GotFocus" >

 

 

 

 

<telerikInput:RadComboBox.ItemTemplate>

 

 

 

 

<DataTemplate>

 

 

 

 

<StackPanel Orientation="Horizontal">

 

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding DefaultEmailAddr}" IsEnabled="False" Width="35" />

 

 

 

 

 

<TextBlock Margin="4,0,4,0" HorizontalAlignment="Left" Text="{Binding EmailAddress}" Width="200" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding BKGFRT}" IsEnabled="False" Width="35" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding BKGNONFRT}" IsEnabled="False" Width="35" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding DRPA}" IsEnabled="False" Width="35" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding DR}" IsEnabled="False" Width="35" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding ONBOARD}" IsEnabled="False" Width="35" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding BOL}" IsEnabled="False" Width="35" />

 

 

 

 

<CheckBox Margin="4,0,4,0" HorizontalAlignment="Center" IsChecked="{Binding BOLNONFRT}" IsEnabled="False" Width="35" />

 

 

 

 

 

</StackPanel>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikInput:RadComboBox.ItemTemplate>

 

 

 

 

</telerikInput:RadComboBox>

 

 

 

 

</DataTemplate>

 

 

 

 

</telerikGridView:GridViewDataColumn.CellEditTemplate>

 

 

 

 

</telerikGridView:GridViewDataColumn>

 

6 Answers, 1 is accepted

Sort by
0
Tai
Top achievements
Rank 1
answered on 16 Sep 2010, 07:32 AM
Hi

why don't you try the OpenDropDownOnFocus = True
and CanAutoCompleteSelectItems = True
0
Maya
Telerik team
answered on 16 Sep 2010, 10:15 AM
Hello Tai,

You may try to use the AutoComplete feature of the RadComboBox. For further information please take a look at this help article.

Sincerely yours,
Maya
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
Scott Nolen
Top achievements
Rank 1
answered on 16 Sep 2010, 02:24 PM
I tried these but neither seemed to work for me.

The data that the radcombo shows (AddressList) comes from a database call. The user may not even use the dropdown at all because it is just if they want to pull a record from a template. A lot of the time they will just want to type in the email address which may or may not be within the templated email addresses. So i need this cell to act like a combo when the user physically clicks the down arrow and only allow entries that it finds when the dropdown is used OR act like a simple cell entry with NO validation if the user just types an email address in.

Example:

AddressList returns if dropdown is used
name1@company.com
name2@company.com

User does NOT use the dropdown but simply types in name3@company2.com .

The way i have it set up the name3@company2.com goes away when i move off of the cell.


0
Maya
Telerik team
answered on 16 Sep 2010, 03:40 PM
Hello Scott Nolen,

You may take a look at this forum thread, where you will find explanations as well as a sample project on the way of achieving that functionality.
 

Regards,
Maya
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
Scott Nolen
Top achievements
Rank 1
answered on 20 Sep 2010, 03:08 PM
That did not help. Everything works until you leave the combo box. Please see if i am missing something with the bindings. It will now allow me to type into the combo any value that i want but when i leave the combo it gets cleared. Note that the grid is bound to one source and the combo is bound to a static resource.


Please help.
0
Maya
Telerik team
answered on 23 Sep 2010, 09:06 AM
Hi Scott Nolen,

In order to fulfill the required functionality, you need to add the item typed in the combo box to its ItemsSource collection. Thus the value you enter will be saved and available in the combo box drop-down. You may find an explanation on the right way of achieving this feature as well as a sample project in this forum thread.
 

Regards,
Maya
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
Scott Nolen
Top achievements
Rank 1
Answers by
Tai
Top achievements
Rank 1
Maya
Telerik team
Scott Nolen
Top achievements
Rank 1
Share this question
or