dataTable.Rows.Clear();
dataTable.BeginLoadData();
((logic for adding rows to the data table is here))
dataTable.CaseSensitive = false;
dataTable.EndLoadData();
radGridView.MasterTemplate.BeginUpdate();
radGridView.MasterTemplate.CaseSensitive = false;
radGridView.DataSource = dataTable;
radGridView.GridBehavior.GridControl.CaseSensitive = false;
radGridView.MasterTemplate.EndUpdate();
I am using the following Telerik library:
WinForms Q3 2011 (version 2011.3.11.1116)
Can you please explain how to turn off case sensitivity for the filters in your WinForm grid control?
Can you also provide the class paths for all the CaseSensitivity flags?
e.g. 1) radGridView.MasterTemplate.CaseSensitive
2) radGridView.GridBehavior.GridControl.CaseSensitive
3) etc...
Thanks so much!
Scott
18 Answers, 1 is accepted
Thank you for writing.
The property that you need to work with in order to modify the case sensitivity of RadGridView is the CaseSensitive property of the desired template. So if you have only one level of data you can set this property of the control, alternatively you need to set it to every child template. Here is a sample code for flat grid, which will demonstrate how this property works.
GridViewTextBoxColumn col =
new
GridViewTextBoxColumn();
radGridView1.Columns.Add(col);
col.Width = 200;
radGridView1.Rows.Add(
"Jim"
);
radGridView1.Rows.Add(
"jim"
);
radGridView1.EnableFiltering =
true
;
radGridView1.MasterTemplate.CaseSensitive =
true
;
I hope that you find this information helpful. Should you have any other questions, do not hesitate to contact us.
All the best,
Stefan
the Telerik team
Q3’11 of RadControls for WinForms is available for download (see what's new). Get it today.
I want to filter RadGrid InSensitive mode, how can I achieve this ?
Thank for future helps.
As I mentioned in my previous post, to enable case sensitive filtering of the grid, you need to set the CaseSensitive property:
radGridView1.MasterTemplate.CaseSensitive =
true
;
I hope this helps.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I mean, It is not working when I try to filter turkish characters "ı,i,ö,ü,ş,ç,ğ,I,İ,Ö,Ü,Ş,Ç,Ğ" in RadGrid.
For exammple :
Record => Kitap, Filter => İ (İ is uppercase)
Record => KİTAP, Filter => i (i is lowercase)
Tnaks
If so, how can I change CultureInfo of Radgrid ?
I have tested this with the examples you provided and seems to be working just fine on my end. Attached you can find a video (opens in browser) of the process.
The culture I have is en-US (Thread.CurrentThread.CurrentUICulture).
What is the culture you have?
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
My culture is tr-TR,
How can I reach the video ?
Thanks for response.
I have tested with "tr-TR" and I get the same behavior.
Let me try to attach the video once again to this post, as it seems it did not appear in the previous one.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I have uploaded the video here for you.
I downloaded video but can't see clearly, please send me a piece of your code or whole demo project ?
Thanks.
The project is what you can see on the video. I have attached it to this post for your convenience.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
I run the project that you attached but I mean :
When I click filter1 or filter2 button, I want to see two record (Kitap and KİTAP) on RadGridView.
How can I do that ?
Thanks.
Thank you for the clarification.
The comparison we perform during the filtering uses InvariantCulture, hence it is culture-insensitive. What I can offer for your case is to use Custom Filtering. Here is a small example:
public
partial
class
Form1 : Form
{
RadGridView radGridView1 =
new
RadGridView();
CultureInfo cultureInfo =
new
CultureInfo(
"tr-TR"
);
public
Form1()
{
InitializeComponent();
this
.Controls.Add(radGridView1);
radGridView1.Size =
new
System.Drawing.Size(300, 300);
radGridView1.Columns.Add(
"column1"
);
radGridView1.Columns[0].Width = 100;
radGridView1.Rows.Add(
"Kitap"
);
radGridView1.Rows.Add(
"KİTAP"
);
radGridView1.EnableFiltering =
true
;
radGridView1.EnableCustomFiltering =
true
;
radGridView1.CustomFiltering += radGridView1_CustomFiltering;
}
void
radGridView1_CustomFiltering(
object
sender, GridViewCustomFilteringEventArgs e)
{
if
(radGridView1.FilterDescriptors.Count == 0)
{
return
;
}
foreach
(var item
in
radGridView1.FilterDescriptors)
{
string
cellValue = e.Row.Cells[item.PropertyName].Value.ToString();
if
(item.Operator == Telerik.WinControls.Data.FilterOperator.Contains)
{
e.Visible = cultureInfo.CompareInfo.IndexOf(cellValue, item.Value.ToString(), CompareOptions.IgnoreCase) > -1;
}
}
if
(e.Visible)
{
e.Handled =
true
;
}
}
private
void
button1_Click(
object
sender, EventArgs e)
{
radGridView1.FilterDescriptors.Clear();
radGridView1.FilterDescriptors.Add(
new
FilterDescriptor(
"column1"
, FilterOperator.Contains,
"İ"
) { IsFilterEditor =
true
});
}
}
I hope that you find it useful.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
It worked fine for contains filter.
How can we change code for all filters (starts with, ends with, not contains, contains, etc...) ?
Thanks.
if
(item.Operator == Telerik.WinControls.Data.FilterOperator.X)
{
//perform your custom filtering
}
I hope this helps.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
Regards.
I try to use the filter of the column (radgridview ) but I want to digit filter in case sensitive.
In the example I wanto to enter "tg" with filter row with "tg- . .. " and not "TG-. . . . ."
Thank you for writing.
The property that you need to work with in order to modify the case sensitivity of RadGridView is the CaseSensitive property of the desired template. So if you have only one level of data you can set this property of the control, alternatively, you need to set it to every child template. Here is a sample code for the flat grid, which will demonstrate how this property works.
this
.radGridView1.MasterTemplate.CaseSensitive =
true
;
I hope this information helps. Should you have further questions I would be glad to help.
Regards,
Dess
Progress Telerik