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

    Hi,

     

    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">
        <ItemTemplate>
            <asp:Label ID="LocationTypeLabel" runat="server"></asp:Label>
        </ItemTemplate>
    </telerik:GridTemplateColumn>

    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") & ", "
    Next

  2. Answer
    Konstantin Dikov
    Admin
    Konstantin Dikov avatar
    1800 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.


    Regards,
    Konstantin Dikov
    Telerik
     

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

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jaya
    Jaya avatar
    81 posts
    Member since:
    Mar 2011

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


    Hi

    Admin

    Can you solve this 

    http://www.telerik.com/forums/how-to-designed-the-aspx-page-and-open-rad-window
Back to Top