4 Answers, 1 is accepted
0
Hello Hosein,
Thank you for your question.
The mechanism for implementing custom filtering for the master and the child templates of RadGridView is the same. All you should do is enable the filtering and custom filtering of the concrete template, add FilterDescriptor to it and subscribe to the CustomFiltering event of RadGridView:
I hope it helps.
Best regards,
Alexander
the Telerik team
Thank you for your question.
The mechanism for implementing custom filtering for the master and the child templates of RadGridView is the same. All you should do is enable the filtering and custom filtering of the concrete template, add FilterDescriptor to it and subscribe to the CustomFiltering event of RadGridView:
this
.radGridView1.Templates[0].EnableFiltering =
true
;
this
.radGridView1.Templates[0].EnableCustomFiltering =
true
;
this
.radGridView1.CustomFiltering +=
new
GridViewCustomFilteringEventHandler(radGridView1_CustomFiltering);
this
.radGridView1.Templates[0].FilterDescriptors.Add(
new
FilterDescriptor());
private
void
radGridView1_CustomFiltering(
object
sender, GridViewCustomFilteringEventArgs e)
{
}
I hope it helps.
Best regards,
Alexander
the Telerik team
0

hosein
Top achievements
Rank 1
answered on 02 Feb 2011, 06:31 PM
Hello
Thanks a lot for answer (I was waiting about three days for any help)
I wrote these codes in radGridView1_CustomFiltering(object sender, GridViewCustomFilteringEventArgs e)
if
(
string
.IsNullOrEmpty(txtSearch.Text))
{
e.Visible =
true
;
for
(
int
i = 0; i < radGridView1.ColumnCount; i++)
{
e.Row.Cells[i].Style.Reset();
e.Row.InvalidateRow();
}
return
;
}
e.Visible =
false
;
for
(
int
i = 0; i <
this
.radGridView1.ColumnCount; i++)
{
string
text = e.Row.Cells[i].Value.ToString();
if
(text.IndexOf(txtSearch.Text, 0, StringComparison.InvariantCultureIgnoreCase) >= 0)
{
e.Visible =
true
;
e.Row.Cells[i].Style.CustomizeFill =
true
;
e.Row.Cells[i].Style.DrawFill =
true
;
e.Row.Cells[i].Style.BackColor = Color.FromArgb(201, 252, 254);
}
else
{
e.Row.Cells[i].Style.Reset();
e.Row.InvalidateRow();
}
}
this.radGridView1.Templates[0].EnableFiltering = true;
this.radGridView1.Templates[0].EnableCustomFiltering = true;
But it does not search the child templates.
How can I change the code to search the child templates too?
Thanks
0

Richard Slade
Top achievements
Rank 2
answered on 02 Feb 2011, 10:29 PM
Hello,
In order to get to the child template, you can itterate over the rows, and inside that loop, itterate over the child rows.
Please see my answer in this forum post regarding getting to the child rows.
Hope that helps
Richard
In order to get to the child template, you can itterate over the rows, and inside that loop, itterate over the child rows.
Please see my answer in this forum post regarding getting to the child rows.
Hope that helps
Richard
0
Hello hosein,
Thank you for writing back.
In regards to the response time, please note that we do support our users within 72 hours (Mon-Fri) for forum threads and within 24-48-72 hours for support tickets (depending on the license that you have). We may provide you with a quicker response, but this depends on the work load that we currently have. If you require a guaranteed quicker response, please consider purchasing one of the licenses that we offer.
Please let us know if you need additional assistance after referring to this forum thread. We will be glad to help you futher.
Kind regards,
Nikolay
the Telerik team
Thank you for writing back.
In regards to the response time, please note that we do support our users within 72 hours (Mon-Fri) for forum threads and within 24-48-72 hours for support tickets (depending on the license that you have). We may provide you with a quicker response, but this depends on the work load that we currently have. If you require a guaranteed quicker response, please consider purchasing one of the licenses that we offer.
Please let us know if you need additional assistance after referring to this forum thread. We will be glad to help you futher.
Kind regards,
Nikolay
the Telerik team