Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > RadControls in ASP.NET MVC > radgrid filtering

Not answered radgrid filtering

Feed from this thread
  • Pallavi avatar

    Posted on Nov 16, 2011 (permalink)

    Hello,

    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">

     

    <ItemTemplate>

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

    </ItemTemplate>

    </telerik:GridTemplateColumn>

    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.

    Thanks
    Pallavi

    Reply

  • Pavlina Pavlina admin's avatar

    Posted on Nov 18, 2011 (permalink)

    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:
    http://www.telerik.com/help/aspnet-ajax/grid-implementing-filtering-for-gridtemplatecolumns.html                

    Best wishes,
    Pavlina
    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

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > RadControls in ASP.NET MVC > radgrid filtering