I want to use Combobox in RadGridview as following:
<telerik:RadGridView Grid.Column="0" Grid.Row="0" x:Name="radGridBidRows" AutoGenerateColumns="False" Margin="10,10,10,0"
SelectionUnit="FullRow" CanUserSelect="True" SelectionMode="Single" >
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn IsVisible="False" IsReadOnly="True" DataMemberBinding="{Binding BID_ROW_ID}" Header="BID_ROW_ID" />
<telerik:GridViewDataColumn SortMemberPath="POL_CODE" Header="POL CODE">
<telerik:GridViewDataColumn.CellTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<HyperlinkButton x:Name="ExHyperlink" Click="ExHyperlink_Click" Content="Details"></HyperlinkButton>
<telerik:RadComboBox x:Name="cmbPOL_CODE" />
</StackPanel>
</DataTemplate>
</telerik:GridViewDataColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
How can I populate programmatically combobox based on row value BID_ROW_ID?
Thanks in advance,
Moshe
9 Answers, 1 is accepted
You may try out the approach demonstrated in this blog post. However, instead of handling the SelectionChanged event of the first ComboBox, all you need to do is to provide your ComboBox with the necessary data source - as it is the AvailableCountries in the example.
Maya
the Telerik team
<telerik:RadGridView Name="radGrdYourName" Grid.Row="0" Style="{StaticResource radGridViewStyle}" RowEditEnded="radGrdYourName_RowEditEnded" CellEditEnded="radGrdYourName_CellEditEnded" ItemsSource="{Binding ElementName=vwYourDomainDataSource, Path=Data}"> <telerik:RadGridView.Columns> <telerik:GridViewComboBoxColumn Header="Your Header" Width="150" DataMemberBinding="{Binding YourColumnID}" ItemsSource="{Binding Data,Source={StaticResource YourStaticResource}}" DisplayMemberPath="YourDataFileldName" SelectedValueMemberPath="YourColumnID" IsReadOnly="False" > </telerik:RadGridView.Columns> </telerik:RadGridView>I saw http://blogs.telerik.com/pavelpavlov/posts/10-01-27/cascading_comboboxes_selection_in_radgridview_for_silverlight_and_wpf.aspx that you sent.
But it's not exactly example that I need.
I'm using telerik:GridViewDataColumn.CellTemplate and Label with RadComboBox in celltetemplate of Gridview.
Can you give me such example?
I know that I can use telerik:GridviewComboColumn,but I want to use celltetemplate.
Thanks in advance,
Moshe
I am sending you a sample project illustrating a possible approach for achieving the desired result. The ItemsSource of the RadComboBox depends on the value of another property of the item.
I hope that helps.
Maya
the Telerik team
Can you give the same example that uses WCF service?
Thanks,
Moshe
Can you give the same example that uses WCF service?
Thanks,
Moshe
Basically, you may follow up the same approach as the one demonstrated in the sample project I have sent. You may extend the functionality of your classes by adding partial classes and add the necessary properties - like AvailableCountries and methods - like UpdateAvailableCountries(). The settings in the xaml file should be again similar to those in the sample.
Greetings,Maya
the Telerik team
Can you give me example of wcf service called synchronously(not asynchronously) that for given row key(bid_row_id) in Row_Loaded event binds to ItemsSource that calculated depended on bid_row_id value?
And then I can use in code DataMemberBinding, SelectedValueMemberPath, DisplayMemberPath, ItemsSourceBinding values to
add binding values to existing GridViewComboBoxColumn or to use these values to bind for existing RadCombobox in celltemplate.
I know that Silverlight supports only asynchronous calls.
Thanks,
Moshe
I am sending you a sample project illustrating another possible approach for achieving the desired result. You may extend its functionality depending on your exact requirements by updating the service call CustomersList and return those whose RowID corresponds to the CustomerID for example.
All the best,Maya
the Telerik team