Allow FILTER a GridTemplate Column when RADTOOL tool is implemented on to the GridTemplate Column

3 posts, 0 answers
  1. Ajay
    Ajay avatar
    66 posts
    Member since:
    May 2009

    Posted 15 Mar 2010 Link to this post

    Hi Telerik !

    I have been using the latest RadGrid Control within my application.

    I have a RadGrid in which I have a 7 columns :-

    Out of which , 3 columns are GRID TEMPLATE COLUMN & all the remaing are BOUND COLUMNS

    I have applied the FILTERS on to two of the GRID TEMPLATE COLUMNS , while the remaing one is for the ACTION purpose(which basically consist of the edit/delete button).

    Lets say :-

    Two GridTemplate Columns are :-

    FILE NAME :- Iam getting the file name displayed in the column

    FILE PATH:- Iam getting the full file path displayed in the column.


    I have implemented the RADTOOL tip on to both the GRIDTEMPLATE COLUMNS, so that in case my file name or file path is too long , I can see its name as an TOOL TIP.

    Now since, FILTER is also implementd on to these two COLUMNS, so when I try to filter the FILE NAME & FILE PATH , Iam getting the below mentioned error :-

    is neither a DataColumn nor a DataRelation for table DefaultView.

    Please help how to filter these two columns ?

    Below is the detailed code :-

                                <telerik:GridTemplateColumn HeaderText="File Name" UniqueName="File_Name" SortExpression="File_Name"
                                        <asp:Label ID="AllFileNameLabel" runat="server" Text='<%# ( Eval("File_Name").ToString().Length > 20)? string.Concat(Eval("File_Name").ToString().Substring(0, 20), "...") : Eval("File_Name") %>'></asp:Label> 
                                        <telerik:RadToolTip ID="AllFileNameRadToolTip" TargetControlID='<%# ( Eval("File_Name").ToString().Length > 20)? "AllFileNameLabel" : "" %>' 
                                            Width="400px" Height="250px" Text='<%# Eval("File_Name") %>' ManualClose="false" 
                                            ContentScrolling="Y" runat="server"
                                    <HeaderStyle HorizontalAlign="Center" /> 
                                <telerik:GridTemplateColumn HeaderText="File Path" UniqueName="File_Path" SortExpression="File_Path"
                                        <asp:Label ID="AllFilePathLabel" runat="server" Text='<%# ( Eval("File_Path").ToString().Length > 20)? string.Concat(Eval("File_Path").ToString().Substring(0, 20), "...") : Eval("File_Path") %>'></asp:Label> 
                                        <telerik:RadToolTip ID="AllFilePathRadToolTip" TargetControlID='<%# ( Eval("File_Path").ToString().Length > 20)? "AllFilePathLabel" : "" %>' 
                                            Width="400px" Height="250px" Text='<%# Eval("File_Path") %>' ManualClose="false" 
                                            ContentScrolling="Y" runat="server"
                                    <HeaderStyle HorizontalAlign="Center" /> 

  2. Radoslav
    Radoslav avatar
    1564 posts

    Posted 18 Mar 2010 Link to this post

    Hello Ajay,

    In order to achieve the desired functionality you need to set the DataField property for the column to a valid data field from the datasource. This ensures that the control properly retrieves the data on which the filtering pattern will be applied.

    Also please check out the following online example which demonstrates filtering of the template columns:

    I hope this helps.

    Best wishes,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Ajay
    Ajay avatar
    66 posts
    Member since:
    May 2009

    Posted 19 Mar 2010 Link to this post

    Hi Radoslav ,

    Thanks a lot for all your suggestion.

    Actually I forgot the property name "DataField" ?

    You guys r ROCKINg...........

    Resolved ...........

Back to Top