radgrid filtering

Thread is closed for posting
2 posts, 0 answers
  1. Pallavi
    Pallavi avatar
    1 posts
    Member since:
    Nov 2011

    Posted 16 Nov 2011 Link to this post


    In my application i have one radgrid. By using this below code I am binding my grid



    <telerik:GridTemplateColumn HeaderText="Roles" UniqueName="Roles" AllowFiltering="true">



    <asp:Label runat="server" ID="lblRoles"></asp:Label>



    and using the below code I am getting values to the labels
    protected void uiUserRoles_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)


    if (e.Item is GridDataItem)

    GridDataItem item = (GridDataItem)e.Item;

    AcsAuthorizationProvider.Entities.ApUser apUser = e.Item.DataItem as AcsAuthorizationProvider.Entities.ApUser;

    if (apUser != null && !string.IsNullOrWhiteSpace(apUser.UserName))


    Label lblRoles = (Label)e.Item.FindControl("lblRoles");

    if (lblRoles != null)


    AcsRoleProvider acsRoleProvider = new AcsRoleProvider();

    string[] roles = acsRoleProvider.GetRolesForUser(apUser.UserName);


    lblRoles.Text = string.Join(", ", roles);







    now I want to apply the filter for the roles column of radgrid.Please help to do that.

  2. Pavlina
    Pavlina avatar
    6069 posts

    Posted 18 Nov 2011 Link to this post

    Hello Pallavi,

    To be able to implement filtering for template columns, you need to set the DataField property of the template column to the field you want to use for filtering. Refer to the help article below for additional information:

    Best wishes,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. DevCraft R3 2016 release webinar banner
Back to Top