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

[Solved] RadCombo FIlters in Subheaders

3 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bobbie
Top achievements
Rank 1
Bobbie asked on 02 Nov 2009, 06:14 PM
Hi All,

Does any one know on how to add RadCombo FIlters in Subheaders?
Here is my aspx code. Plz help me.
<telerik:RadGrid runat="server" ID="RadGrdDashboard"  
                AllowPaging="True"  
                AutoGenerateColumns="False"  
                PageSize="5" 
                ShowStatusBar="True" 
                EnableAJAX="True"  
                DataSourceID="dsParent"  
                GridLines="None"  
                AllowFilteringByColumn="True" 
                Width="100%" 
                OnItemCreated="RadGrdDashboard_ItemCreated" 
                > 
                 
                    <MasterTableView DataSourceID="dsParent"
                        <PagerStyle Mode="NextPrevAndNumeric" /> 
                        <Columns> 
                            <telerik:GridBoundColumn HeaderText="CustomerID" DataField="CustomerID" UniqueName="CustomerID" AllowFiltering="true"
                            <FilterTemplate>  
                                        <telerik:RadComboBox ID="RadComboBoxContractID" runat="server"  
                                        OnClientSelectedIndexChanged="filterByCustomerID"  
                                         SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CustomerID").CurrentFilterValue %>' Width="95px"
                                        <Items>  
                                            <telerik:RadComboBoxItem Text="All"  Value="All" />  
                                            <telerik:RadComboBoxItem Text="ALFKI" Value="ALFKI" /> 
                                            <telerik:RadComboBoxItem Text="ISLAT" Value="ISLAT" /> 
                                        </Items>  
                                    </telerik:RadComboBox>  
                            </FilterTemplate>  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn HeaderText="Contact Name" DataField="ContactName" UniqueName="ContactName" AllowFiltering="false"
                            </telerik:GridBoundColumn> 
                            <telerik:GridTemplateColumn UniqueName="TemplateColumn"
                               <HeaderTemplate> 
                                <table id="Table1" cellSpacing="1" cellPadding="1" width="300" border="0"
                                 <tr> 
                                  <td colspan="3" align="center"><b>Contact Info</b></TD
                                 </tr> 
                                 <tr> 
                                  <td width="50%" headers="ContactTitle" id="ContactTitle"><b>Contact Title</b></TD
                                  <td width="50%"><b>City</b></TD
                                  <td width="50%"><b>Phone</b></TD
                                 </tr> 
                                </table> 
                               </HeaderTemplate> 
                               <ItemTemplate> 
                                <table id="Table2" cellSpacing="1" cellPadding="1" width="300" border="0"
                                 <tr> 
                                  <td width="50%"><%# DataBinder.Eval(Container.DataItem, "ContactTitle")%></TD
                                  <td width="50%"><%# DataBinder.Eval(Container.DataItem, "City")%></TD
                                  <td width="50%"><%# DataBinder.Eval(Container.DataItem, "Phone")%></TD
                                 </tr> 
                                </table> 
                               </ItemTemplate> 
                              </telerik:GridTemplateColumn> 
                            <telerik:GridBoundColumn HeaderText="Company Name" DataField="CompanyName" UniqueName="CompanyName" AllowFiltering="false"
                            </telerik:GridBoundColumn> 
                            <telerik:GridTemplateColumn UniqueName="TemplateColumn1"
                               <HeaderTemplate> 
                                <table id="Table11" cellSpacing="1" cellPadding="1" width="300" border="0"
                                 <tr> 
                                  <td colspan="2" align="center"><b>Company Info</b></TD
                                 </tr> 
                                 <tr> 
                                  <td width="50%"><b>Country</b></TD
                                  <td width="50%"><b>Fax</b></TD
                                 </tr> 
                                </table> 
                               </HeaderTemplate> 
                               <ItemTemplate> 
                                <table id="Table21" cellSpacing="1" cellPadding="1" width="300" border="0"
                                 <tr> 
                                  <td width="50%"><%# DataBinder.Eval(Container.DataItem, "Country")%></TD
                                  <td width="50%"><%# DataBinder.Eval(Container.DataItem, "Fax")%></TD
                                 </tr> 
                                </table> 
                               </ItemTemplate> 
                              </telerik:GridTemplateColumn> 
                        </Columns> 
                    </MasterTableView> 
                    <ClientSettings> 
                        <ClientEvents OnColumnClick="ColumnClick" OnGridCreated="GridCreated"/> 
                         
                    </ClientSettings> 
                </telerik:RadGrid> 
    <asp:AccessDataSource ID="dsParent" DataFile="App_Data/Nwind.mdb" SelectCommand="SELECT * FROM Customers" 
                runat="server"></asp:AccessDataSource> 




3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 03 Nov 2009, 08:06 AM
Hello Bobbie,

I suppose you want to add the combobox filters with the subheaders of your template column. If so, check out the following example:
aspx:
<HeaderTemplate>  
    <table id="Table1" cellSpacing="1" cellPadding="1" width="300" border="0">  
         <tr>  
               <td colspan="3" align="center"><b>Contact Info</b></TD>  
         </tr>  
         <tr>  
              <td width="50%" headers="ContactTitle" id="ContactTitle"><b>Contact Title</b></TD>  
              <td width="50%"><b>City</b></TD>  
              <td width="50%"><b>Phone</b></TD>  
         </tr>  
          <tr>  
              <td width="50%"><telerik:RadComboBox ID="filterRadComboBox1" runat="server"></telerik:RadComboBox></TD>  
              <td width="50%"><telerik:RadComboBox ID="filterRadComboBox2" runat="server"></telerik:RadComboBox></TD>  
              <td width="50%"><telerik:RadComboBox ID="filterRadComboBox3" runat="server"></telerik:RadComboBox></TD>  
         </tr>  
    </table>  
</HeaderTemplate>  

Also check out the following code library submission which illustrates how to perform individual filtering for each sub-column using dropdown lists as filters(the application attached with the last post).
Individual filtering and sorting for "sub-columns" in template column

Thanks
Princy.
0
Bobbie
Top achievements
Rank 1
answered on 03 Nov 2009, 11:13 AM
Thanks Princy. I'll try this & get back to you.

Thanks
Bobbie
0
Bobbie
Top achievements
Rank 1
answered on 03 Nov 2009, 10:56 PM
Thanks for your reply Princy,

I checked out the article, that is very helpful. But I want to do all that using templates & client API's since my page is all AJAX enabled. I cannot do that on server side.

Plz help me fix this issue.


Thanks
Bobbie


Tags
Grid
Asked by
Bobbie
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Bobbie
Top achievements
Rank 1
Share this question
or