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

[Solved] Checkbox Search Issues With Grid

1 Answer 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nitin
Top achievements
Rank 1
nitin asked on 19 Aug 2009, 10:52 AM
Hi Ail,,

i am using telerik 2009.20 version ajax aspnet toolkit..

i have a gridview which is binded via dataset at Runtime in Need Datasource Event of RadGrid. with this binding i am binding two checkboxes also based on some condition.. and these two columns are taken as template columns.. i want to search the grid like if a user has selected one checkbox and presses ENTER key, he must see the grid that has only checked values corresponding to the checkbox.

Please help ASAP.

Thanks



1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Aug 2009, 05:47 AM
Hi Nitin,

I guess you can use the Built-in filtering feature of the Grid where you can enable the AutoPostBackOnFilter property to true
and set the CurrentFilterFunction property for the GridTemplateColumn to achieve the desired scenario.  Here is a sample code. Try with the following approach and see whether it meets your requirement.

ASPX:
 
 <telerik:GridTemplateColumn UniqueName="TempCol" DataField="Discontinued" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" AllowFiltering="true" HeaderText="TempCol" DataType="System.Boolean"  > 
                      <ItemTemplate> 
                          <asp:CheckBox ID="CheckBox1" runat="server"  Checked='<%#Eval("Discontinued") %>'/> 
                      </ItemTemplate> 
                    </telerik:GridTemplateColumn> 

You may also refer the following link for more details about filtering with Template Columns.
Implementing filtering for template/custom columns
Search on key press/button click

Shinu

Tags
Grid
Asked by
nitin
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or