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

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

2 Answers 43 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ajay
Top achievements
Rank 2
Ajay asked on 15 Mar 2010, 02:39 PM
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.


Also:;

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

 <Columns> 
                            <telerik:GridTemplateColumn HeaderText="File Name" UniqueName="File_Name" SortExpression="File_Name"
                                <ItemTemplate> 
                                    <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"
                                    </telerik:RadToolTip> 
                                </ItemTemplate> 
                                <HeaderStyle HorizontalAlign="Center" /> 
                            </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn HeaderText="File Path" UniqueName="File_Path" SortExpression="File_Path"
                                <ItemTemplate> 
                                    <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"
                                    </telerik:RadToolTip> 
                                </ItemTemplate> 
                                <HeaderStyle HorizontalAlign="Center" /> 
                            </telerik:GridTemplateColumn> 


Ajay

2 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 18 Mar 2010, 08:59 AM
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:
http://demos.telerik.com/aspnet-ajax/grid/examples/programming/filteringtemplatecolumns/defaultcs.aspx

I hope this helps.

Best wishes,
Radoslav
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.
0
Ajay
Top achievements
Rank 2
answered on 19 Mar 2010, 01:32 PM
Hi Radoslav ,

Thanks a lot for all your suggestion.

Actually I forgot the property name "DataField" ?

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

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

Thanks 
Tags
Grid
Asked by
Ajay
Top achievements
Rank 2
Answers by
Radoslav
Telerik team
Ajay
Top achievements
Rank 2
Share this question
or