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

Grid template column filtering

1 Answer 39 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dharmesh
Top achievements
Rank 1
Dharmesh asked on 16 Oct 2013, 02:57 PM
Hello All,

I have rad grid with one template column(of <asp:Label Id="lblTemplate" runat="server" />). In grid's ItemDataBoud event, I am assigning that
label's value using some other data source(not used by Grid).

Grid renders perfectly but inbuilt filtering is not working as I have not assign "DataField" property on "TemplateColumn". I couldn't do so because "DataField" is not available in Grid's data source but available in another data source which is I am using in ItemDataBound event.

What is best and efficient way to achieve my requirement?
If I need to use custom filtering then how can I do so?
Regards,
Dharmesh

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 17 Oct 2013, 05:51 AM
Hello,

Method 1 : Grid - Programmatic Sorting

Method 2 : You have to create one more Entity/Column/Property and use this column to show Data in your grid.

public class User
{
    public string FirstName { get; set; }
    public string LastName { get; set; }
 
    // I have created this property only for display data in grid, to achieve sorting and filtering.
    public string FullName
    {
        get
        {
            return FirstName + " " + LastName;
        }
    }
}


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Dharmesh
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or