RadGrid filter on label in GridTemplateColumn

3 posts, 1 answers
  1. Alexander
    Alexander avatar
    67 posts
    Member since:
    Jun 2014

    Posted 14 Apr 2015 Link to this post



    I have a RadGrid with a GridTemplateColumn that has a label inside it. This label is populated after the initial datatable is bound to the grid.

    Is there any way that I can filter on the contents of this label without having it in my initial datatable?

    Here is my template column

    <telerik:GridTemplateColumn AllowFiltering="true" HeaderText="Type(s)" UniqueName="column10"
                        AutoPostBackOnFilter="true" ShowFilterIcon="false">
            <asp:Label ID="LocationTypeLabel" runat="server"></asp:Label>

    This is how I populate the label. The datatable _dtTypes is actually the second table returned in the dataset whereas the first table is the datasource of the grid.

    For Each dr As DataRow In _dtTypes.Select("CustomerID = " & e.Item.DataItem("CustomerID"))
      lbl.Text = lbl.Text & dr("LocationType") & ", "

  2. Answer
    Konstantin Dikov
    Konstantin Dikov avatar
    2120 posts

    Posted 17 Apr 2015 Link to this post

    Hi Alexander,

    All data related operations (like filtering, sorting, grouping, etc.) are performed on the underlying data source and on a specific data field. With that in mind, it is not possible to filter the content of the displayed value in your GridTemplateColumn, unless you have a data field in your data source with that content.

    Hope this helps.

    Konstantin Dikov

    See What's Next in App Development. Register for TelerikNEXT.

  3. Jaya
    Jaya avatar
    85 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2015 in reply to Konstantin Dikov Link to this post



    Can you solve this 

Back to Top