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

RadGrid filter on label in GridTemplateColumn

2 Answers 130 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 14 Apr 2015, 10:15 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 17 Apr 2015, 10:31 AM
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.

 
0
Jaya
Top achievements
Rank 1
answered on 22 Apr 2015, 06:20 AM

Hi

Admin

Can you solve this 

http://www.telerik.com/forums/how-to-designed-the-aspx-page-and-open-rad-window
Tags
Grid
Asked by
Alexander
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Jaya
Top achievements
Rank 1
Share this question
or