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

how apply filter in gridtemplatecolumn itemtemplate use ternary

1 Answer 37 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rahul
Top achievements
Rank 1
rahul asked on 18 Nov 2014, 03:59 AM
Hi, I want to apply filter on item template contains ternary how can do this.

 <telerik:GridTemplateColumn UniqueName="IsAverage"  HeaderText="Average/Sum" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"  AllowFiltering="false" >                                                                                                                               
       <ItemTemplate>  
      <asp:Label Id="active" runat="server" Text='<%# Convert.ToBoolean(Eval("IsAverage")) == true ? "Average" : "Sum" %>'></asp:Label>                                                     </ItemTemplate>                                                                  
            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
       <ItemStyle HorizontalAlign="Left"></ItemStyle>
  </telerik:GridTemplateColumn>

please provide example or solution with source code.

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 20 Nov 2014, 12:32 PM
Hello,

Could you please elaborate a bit more on your scenario? What is the type of the underling column data? The RadGrid filters the column based on the type of the data to which the column is bound. Additionally the grid’s column has FilterTemplate which you can use in order to implement an advanced filter for the column. On the following link you can find a live example which demonstrates this:
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultcs.aspx

Please check it out and let me know if it helps you.

Regards,
Radoslav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
rahul
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or