Hi from France !
I need to make specific filter by column. columns are itemTemplate. in my original projet i've got many data in different columns/template like this :
<telerik:GridTemplateColumn UniqueName="situationCertif" ItemStyle-CssClass="situationBloc"> <ItemTemplate> <asp:Label ID="libFacture" runat="server" Text='<%# String.Format("Facture n° {0}", Eval("LibFacture"))%>'></asp:Label> <asp:Label ID="lMontantHT" runat="server" Text='<%# String.Format("Montant HT : {0:C2}", Eval("MontantHT"))%>'></asp:Label> <asp:Label ID="lMontantTTC" runat="server" Text='<%# String.Format("Montant TTC : {0:C2}", Eval("MontantTTC"))%>'></asp:Label> <asp:Label ID="lEtat" runat="server" Text='<%# String.Format("Etat : {0}", Eval("Etat.LongString"))%>'></asp:Label> <div> Payer à : <asp:Label ID="lTiersPayeur" runat="server" CssClass="tiers" Text='<%# String.Format("{0}", Eval("NomTiersPayeur"))%>'></asp:Label> </div> </ItemTemplate> </telerik:GridTemplateColumn>
I've maked a sample to search how to made this (see Grid.png)
i've got a class "TestData" binded to template columns :
Public Class TestData Property Nom As String Property Prenom As String Property age As Integer Property statut As String Property Infos As String Public Sub New(nom As String, prenom As String, age As Byte, statut As String, infos As String) Me.Nom = nom Me.Prenom = prenom Me.age = age Me.statut = statut Me.Infos = infos End SubEnd ClassPrivate Sub SetGridData() Dim list As New List(Of TestData) From { New TestData("Albert", "Bebert", 28, "Directeur", "ux texte standard de l'imprimerie depuis les années 1500, quand un imprimeur anonyme assembla ensemble des morceaux de texte pour réaliser un livre spécimen"), New TestData("Bilal", "Ournis", 25, "Ingénieur", ""), New TestData("Jerôme", "Nimo", 35, "Commercial", " sans que son contenu n'en soit modifié. Il a été popularisé dans les années 1960 grâce à la "), New TestData("Elvira", "Pas", 50, "Commercial", ""), New TestData("Sylvestre", "Saint", 47, "Commercial", "s suites logicielles de mise en page ou éditeurs de sites Web ont fait du Lorem Ipsum leur faux texte par défaut, et une recherche pour 'Lorem Ipsum' vous cond") } RadGrid1.DataSource = listEnd Sub
<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="true" AutoGenerateColumns="false" OnInit="RadGrid1_Init" OnItemCommand="RadGrid1_ItemCommand"> <MasterTableView> <Columns> <telerik:GridTemplateColumn FilterListOptions="VaryByDataTypeAllowCustom" DataField="demo" UniqueName="demo"> <ItemTemplate> <h1><%# Eval("Nom") %></h1> <h3><%# Eval("Prenom") %></h3> <i><%# Eval("Age") %></i> </ItemTemplate> </telerik:GridTemplateColumn> <telerik:GridTemplateColumn FilterListOptions="VaryByDataTypeAllowCustom" DataField="infos" UniqueName="infos"> <ItemTemplate> <p><b><%# Eval("Statut") %></b></p> <p><%# Eval("Infos") %></p> </ItemTemplate> </telerik:GridTemplateColumn> </Columns> </MasterTableView> </telerik:RadGrid>
example :
First column i need to search in "Nom" or "Prenom" or "Age" properties (contain mode)
Second column i need to search in "Statut" or "Infos" properties (contain mode)
How to define a filter menu by column ?
Thanks for your help, and excuse me for my bad english.
