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

Radgrid Filtering Problem

1 Answer 24 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Lokesh
Top achievements
Rank 1
Lokesh asked on 04 May 2011, 02:45 PM
Hi Team,
I have a radgrid with template columns in it.
When I try to apply filter on the ttemplate column it gives me the strange error.
I tried a lot to get the solution but couldn't find...     :(
Please help me at this..

This is what I have on aspx :

<telerik:RadGrid ID="rgProjectBudget" runat="server" AllowFilteringByColumn="true" AllowMultiRowSelection="true" AllowPaging="true"
                                            OnNeedDataSource="rgProjectBudget_NeedDataSource" OnDeleteCommand="rgProjectBudget_DeleteCommand" PageSize="50"
                                            OnItemDataBound="rgProjectBudget_ItemDataBound" OnPreRender="rgProjectBudget_PreRender" PagerStyle-AlwaysVisible="true" >
                                            <ClientSettings  Selecting-AllowRowSelect="true">
                                                <ClientEvents OnRowSelected="RowSelected" />
                                            </ClientSettings>
                                    <MasterTableView EditMode="InPlace">
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="COABudgetDetailID" DataType="System.Int32"
                                                                HeaderText="COABudgetDetailID" Display="false"
                                                                UniqueName="COABudgetDetailID" AutoPostBackOnFilter="true">
                                        </telerik:GridBoundColumn>
<telerik:GridTemplateColumn HeaderText="Project Budget" UniqueName="SecondaryEntityBudget"
                                                                    CurrentFilterFunction="Contains" AllowFiltering="true" AutoPostBackOnFilter="true">
                                                                    <ItemStyle Width="20%" />
                                            <ItemTemplate>
                                               <asp:TextBox ID="txtBudgetAmount" runat="server" Width="70px"
                                                        Text='<%# DataBinder.Eval(Container,"DataItem.SecondaryEntityBudget") %>' />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn UniqueName="COAActualAmount" HeaderText="Actual Amount" DataField="COAActualAmount"
                                                                 CurrentFilterFunction="EqualTo" AllowFiltering="true" DataType="System.Double" FilterControlWidth="30%"
                                                                 AutoPostBackOnFilter="true">
                                            <HeaderStyle Width="10%" HorizontalAlign="Left" />
                                            <ItemStyle  Width="10%" HorizontalAlign="Left" />
                                        </telerik:GridBoundColumn>


I want to apply filter on SecondaryEntityBudget column.
I have attached the image file of the error that I am getting.
Please help me guys...   :(

Regards,
Lok..

1 Answer, 1 is accepted

Sort by
0
Iana Tsolova
Telerik team
answered on 06 May 2011, 12:13 PM
Hello Lokesh,

Try setting the DataField property of the GridTemplateColumn. Find more information in the below article:
http://www.telerik.com/help/aspnet-ajax/grid-implementing-filtering-for-gridtemplatecolumns.html

All the best,
Iana
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
Lokesh
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
Share this question
or