Hello,
I am using Radgrid. I have dynamically added columns in this grid like mentioned below. I wanted to add filter for some of the columns. What is the way to enable this so that some columns will have filter. I am using custom paging so how to make filter on complete records instead of current page records? Also there is column for phone where records are displayed as (123)-456-1234. If user enters 12345.. then also it should search the phone.
I am using Radgrid. I have dynamically added columns in this grid like mentioned below. I wanted to add filter for some of the columns. What is the way to enable this so that some columns will have filter. I am using custom paging so how to make filter on complete records instead of current page records? Also there is column for phone where records are displayed as (123)-456-1234. If user enters 12345.. then also it should search the phone.
GridBoundColumn boundColumn1 = new GridBoundColumn();RadGrid1.MasterTableView.Columns.Add(boundColumn1);boundColumn1.ItemStyle.Wrap = false;boundColumn1.DataField = DataField;boundColumn1.SortExpression = DataField;
boundColumn1.HeaderText = HeaderText;5 Answers, 1 is accepted
0
Jayesh Goyani
Top achievements
Rank 2
answered on 03 Apr 2013, 11:12 AM
Hello,
Thanks,
Jayesh Goyani
// Allow Column for all column RadGrid1.AllowFilteringByColumn = true; GridBoundColumn boundColumn1 = new GridBoundColumn(); RadGrid1.MasterTableView.Columns.Add(boundColumn1); boundColumn1.ItemStyle.Wrap = false; boundColumn1.DataField = DataField; boundColumn1.SortExpression = DataField; boundColumn1.HeaderText = HeaderText; // Disable filter to this column boundColumn1.AllowFiltering = false;Thanks,
Jayesh Goyani
0
Chetan
Top achievements
Rank 1
answered on 04 Apr 2013, 05:59 AM
Thank you Jayesh, it worked for me. I also wanted to know that there is column for phone where records are displayed as (123)-456-1234. If user enters 12345.. then also it should search the phone. Any thoughts on this?
0
Shinu
Top achievements
Rank 2
answered on 04 Apr 2013, 06:49 AM
Hi,
One suggestion is that you can use GridMaskedColumn for the purpose .This column type is for values that fit a specific format. Set the Mask property to specify an edit mask that defines the valid values. Check the following help documentation for more.
Column Types
Thanks,
Shinu.
One suggestion is that you can use GridMaskedColumn for the purpose .This column type is for values that fit a specific format. Set the Mask property to specify an edit mask that defines the valid values. Check the following help documentation for more.
Column Types
Thanks,
Shinu.
0
Chetan
Top achievements
Rank 1
answered on 04 Apr 2013, 11:32 AM
Actually I have two columns, FormattedPhone and Phone. FormattedPhone has phone like (123)123-1234 and Phone has value like 1231231234. I have boundcolumn which has data coming from FormattedPhone column. Also I have added filter for this column. When I search the record like 1234, it should return this phone. Is there any way so that I can change search column name to Phone from FormattedPhone.
Thank you
Thank you
0
Hello Chetan,
I am afraid it is difficult to figure out your exact requirement. Can you please elaborate on your specific scenario and provide us some screenshots demonstrating the desired behavior?
Looking forward to your reply.
Greetings,
Eyup
the Telerik team
I am afraid it is difficult to figure out your exact requirement. Can you please elaborate on your specific scenario and provide us some screenshots demonstrating the desired behavior?
Looking forward to your reply.
Greetings,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
