We are using ComboBox on the Column Header of RadGridView.
Is there any way to use different Item Source property for RadGridView and ComboBox?
Thanks & Regards,
Mathanlal A.J.
3 Answers, 1 is accepted
You can set any source to the combo, since you are creating it. For example:
RadComboxBox myCombo = new RadComboBox();
myCombo.ItemsSource = <<somethig>>
this.radGridView.Columns[0].Header = myCombo.
I hope this helps.
All the best,
Ross
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.
Thanks for your quick response. I appreciate it.
As you mentioned, it works fine in dynamic creation of combobox.
Just I want to know about the same in the design time creation.
For eg. find some code snippets like below.
<
telerikGridView:RadGridView x:Name="dgEmpEarnings"
MultipleSelect="False"
DataLoadMode="Asynchronous"
AreRowDetailsFrozen="True"
ItemsSource="{Binding empEarnHistoryDetail, Mode=TwoWay}"
IsReadOnly="True"
AutoGenerateColumns="False"
VerticalAlignment="Stretch"
ColumnsWidthMode="Fill"
CanUserFreezeColumns="False"
UseAlternateRowStyle="True"
ColumnBackground="{x:Null}"
ShowGroupPanel="False"
RowIndicatorVisibility="Collapsed"
ScrollMode="RealTime"
Style="{StaticResource RadGridViewSettings}"
Background="#E1EEFF"
GridLinesVisibility="Vertical"
>
<telerikGridView:RadGridView.Columns>
<telerikGridView:GridViewDataColumn x:Name="ColHistDescription" UniqueName="dgColHistDescription" |
Header="Description" |
HeaderTextAlignment="Center"> |
<telerikGridView:GridViewDataColumn.HeaderCellStyle> |
<Style TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderCell"> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="Telerik_Windows_Controls_GridView:GridViewHeaderCell"> |
<ComboBox x:Name="cmbDescription" HorizontalAlignment="Stretch" Height="20" |
SelectedIndex="0" |
ItemsSource="{Binding ActiveEarnings}" |
DisplayMemberPath="LongTitle"> |
</ComboBox> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
</telerikGridView:GridViewDataColumn.HeaderCellStyle> |
<telerikGridView:GridViewDataColumn.CellTemplate> |
<DataTemplate> |
<TextBlock x:Name="txtblkDesc" Text="{Binding EarnDescription}" Margin="5,0,0,0" ></TextBlock> |
</DataTemplate> |
</telerikGridView:GridViewDataColumn.CellTemplate> |
</telerikGridView:GridViewDataColumn> </
telerikGridView:RadGridView.Columns>
</telerikGridView:RadGridView>
|
Please let me know if it is possible.
Thanks & Regards,
Mathanlal A.J.
I doubt that this will be possible, since the Combo is inside a Control template. But what you can do is the following. Attach to the combo's Loaded event. Then in the event handler set its ItemsSource to the correct thing. I hope this helps.
Kind regards,
Ross
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.