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

How to bind a Combobox in Header of RadGridView

7 Answers 265 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mathan lal
Top achievements
Rank 1
Mathan lal asked on 24 Aug 2009, 08:05 AM
Hi,

We need to bind a combobox in the Header of RadGridView.

Please let us know how we can achieve this.
 

Thanks in advance.

7 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 Aug 2009, 02:44 PM
Hi Mathan lal,

Can  you please give me some more details on your scenario including where should the combo be placed  - the column headers, the groupPanel etc.  What data do you need displayed in the combo and what action should it perform on changing selected items.

This will be of great help for me to provide a working sample.

Sincerely yours,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mathan lal
Top achievements
Rank 1
answered on 26 Aug 2009, 06:12 AM
Hi,

Thanks for your response.

Here we need to show a combobox in a RadGrid Header column.

ie. We are having five columns in a grid. The columns are Start Date, End Date, Description, YTD and Type.

In the above header columns, the YTD column header (not in the rows) should be shown as a combobox and the user can select any item (like YTD, QTD and MTD) from the combobox. Based on the selection, the column value will be calculated and displayed.

We tried with the CellTemplate but it is showing in the row not in the header.

Please let us know how we can achieve this.
0
Pavel Pavlov
Telerik team
answered on 26 Aug 2009, 08:46 AM
Hello Mathan lal,

GridViewDataColumn has a Header property. You may set the header to be a ComboBox the following way :

<

telerik:GridViewDataColumn ..... >

 

 

    <telerik:GridViewDataColumn.Header>

 

 

        <ComboBox HorizontalAlignment="Stretch" Height="20" />

 

 

    </telerik:GridViewDataColumn.Header>

 

 

</telerik:GridViewDataColumn>

 


In case you have further difficulties or questions while implementing your scenario don't hesitate to contact me.

Best wishes,
Pavel Pavlov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mathan lal
Top achievements
Rank 1
answered on 26 Aug 2009, 10:17 AM
Hi Pavel,

Thanks for your quick response and it is solved our problem.

Great work!!!

Thanks,
Mathanlal
0
Justin Manjooran
Top achievements
Rank 1
answered on 24 Sep 2009, 09:02 AM
I tried it out for a RadGridView
        <telerikGridView:RadGridView x:Name="contactsRadGridView"  IsReadOnly="True" AutoGenerateColumns="False" ColumnsWidthMode="Fill" Grid.ColumnSpan="2">
                    <telerikGridView:RadGridView.Columns>
                        <telerikGridView:GridViewDataColumn>
                            <telerikGridView:GridViewDataColumn.Header>
                                <ComboBox HorizontalAlignment="Stretch" Height="20" />
                            </telerikGridView:GridViewDataColumn.Header>
                        </telerikGridView:GridViewDataColumn>
                        <telerikGridView:GridViewDataColumn HeaderText="Name"   />
                        <telerikGridView:GridViewDataColumn HeaderText="Phone No"   /> 
                   </telerikGridView:RadGridView.Columns>
                </telerikGridView:RadGridView>

I am getting an error

The attachable property 'Header' was not found in type 'GridViewDataColumn'.
0
Vlad
Telerik team
answered on 24 Sep 2009, 09:16 AM
Hello Justin,

Do you have our latest version? This property was introduced for Q1 2009 SP1.

Sincerely yours,
Vlad
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.
0
Jack Helm
Top achievements
Rank 1
answered on 07 May 2010, 01:56 PM
I hate to dredge this up but I am getting the same error message when I try to use the GridViewDataColumn.Header tag. And my version is Q3 2009 SP2. I am trying to duplicate the example in one of the demos. Any thoughts on why I might be getting this?
Tags
GridView
Asked by
Mathan lal
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Mathan lal
Top achievements
Rank 1
Justin Manjooran
Top achievements
Rank 1
Vlad
Telerik team
Jack Helm
Top achievements
Rank 1
Share this question
or