I'm new to the Telerik controls so sorry if there's a simple answer to these questions. I have a Grid that I populate using a stored procedure that has custom paging and filtering. I don't want to display the filter icon so I looked at the example below:
http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/filtering/defaultcs.aspx
And I realized that the ShipName column was exactly what I needed. It works, except that locally, when I type something into the filter textbox and press Enter, nothing happens. I need to click the Grid itself in order for it to apply the filtering. The online demo works great. I copied the exact same code from the demo into my PC, just used a different datasource and the Enter key won't work anymore. Am I missing something? This is how I'm declaring my column:
<
telerik:GridBoundColumn DataField="EmailAddress" AllowFiltering="true" HeaderText="Email Address" FilterControlWidth="150px"
AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="EmailAddress"/>
Also, how do I retrieve the name of the column and the value users typed into the textbox when clicking enter when filtering? The closest I saw was the FilterExpression property of the MasterTableView, but it doesn't give me the column and value entered as separate values, so I'd have to parse through it to figure it out, unless there is a better way.
Thank you in advance!
6 Answers, 1 is accepted
Thank you! That's exactly what I was looking for.
As far as the problem with the Enter key, I have AllowFilteringByColumn="true" under both the Grid Level and I even added to the MasterTableView just in case, and the problem still happens.
I'm using IE8, along with RadControls for ASPNET AJAX Q1 2009 under Visual Studio 2008 .NET Framework 3.5 SP 1
I had actually used an earlier version of the RadControls and I got the same behavior, so I upgraded thinking it would solve the problem, but it didn't. What is strange is that when I try the demo I mentioned earlier online using the same browser, the grid behaves as expected (I enter a value, hit enter and it refreshes with the filtered data).
I must be overlooking something, this is the entire grid I modified from the demo, I just added one column to it and it didn't work, I hit enter and nothing happens, but as soon as I click anywhere else in the grid I get my filtered data:
<
telerik:RadGrid AutoGenerateColumns="false" ID="RadGrid1" DataSourceID="SqlDataSource1"
Width="760px" AllowFilteringByColumn="True" AllowSorting="True"
PageSize="15" ShowStatusBar="true" ShowFooter="True" AllowPaging="True" runat="server"
GridLines="None" EnableLinqExpressions="false">
<PagerStyle Mode="NextPrevAndNumeric" />
<GroupingSettings CaseSensitive="false" />
<MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True" ShowFooter="True"
TableLayout="Auto">
<Columns>
<telerik:GridBoundColumn FilterControlWidth="105px" DataField="EmailAddress" HeaderText="EmailAddress" SortExpression="EmailAddress" UniqueName="EmailAddress" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings>
<Scrolling AllowScroll="false" />
</ClientSettings>
</telerik:RadGrid>
Thank your for suggestion. It still does the same behavior, I don't know what to do anymore. I copied the code and pasted it into another project in a different PC, and it works the way it should! I'm not going to worry about it for now, thank you for your help!
Juan.