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

Rad grid view filtering

5 Answers 184 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Julian Samuel
Top achievements
Rank 1
Julian Samuel asked on 02 Sep 2010, 10:40 PM

Special characters should be validated in the grid view filter cell & Custom filter dialog from context menu

 

I  tried the following ways and it was successful for Rad grid view filter cell

 

I tried validating in filter changing event while the user enters in the filter cell

 

If (grid.IsInEditMode = True) Then

                If (grid.ActiveEditor.Value IsNot Nothing) Then

                    Dim strFilterCellValue As String = grid.ActiveEditor.Value

                    If (strFilterCellValue.Contains("*") Or strFilterCellValue.Contains("[")) Then

                        Dim lastIndexOfFilterCell As Integer = strFilterCellValue.Count - 1

                        Dim strNewFilterCellValue As String = strFilterCellValue.Remove(lastIndexOfFilterCell, 1)

                        grid.ActiveEditor.Value = strNewFilterCellValue

                        grid.CurrentCell.Editor.BeginEdit()

                        Return 1

                        Exit Function

                    End If

                End If

            End If

 

And for Custom filter menu

 

            If (cellValue IsNot Nothing) Then

                Dim totalCount As Integer = cellValue.Count

                If (cellValue.Contains("*")) Then

                    Dim indexOfStar As String = cellValue.IndexOf("*")

                    Dim numOfCharsRemoved As String = totalCount - indexOfStar

                    Dim strNewFilterCellValue As String = cellValue.Remove(indexOfStar, numOfCharsRemoved)

                    grid.CurrentCell.Value = strNewFilterCellValue

                    grid.MasterGridViewTemplate.FilterExpressions.EndItemUpdate()

                    Return 2

                    Exit Function

                End If

                If (cellValue.Contains("[")) Then

                    Dim indexOfOpenBracket As String = cellValue.IndexOf("[")

                    Dim numOfCharsRemoved As String = totalCount - indexOfOpenBracket

                    Dim strNewFilterCellValue As String = cellValue.Remove(indexOfOpenBracket, numOfCharsRemoved)

                    grid.CurrentCell.Value = strNewFilterCellValue

                    grid.MasterGridViewTemplate.FilterExpressions.EndItemUpdate()

                    Return 2

                    Exit Function

                End If

 

The issue is I m unable to validate both together  that is for custom filter option & while the user enters in the filter cell

 

Thanks,

Julian

5 Answers, 1 is accepted

Sort by
0
Jack
Telerik team
answered on 07 Sep 2010, 04:15 PM
Hi Julian Samuel,

Thank you for contacting us. This is a known issue and it will be addressed in our upcoming service pack which will be ready later this month. 

If you have other questions, please write me back.

Best wishes, Jack
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Achuthan
Top achievements
Rank 1
answered on 07 Jan 2011, 02:45 PM
So is it fixed now? I'm getting unhandled error generated by Radgrid when I filter using the keyword

`~!@#$%^&*()-=_+[]\{|}|;':",./<>?

0
Richard Slade
Top achievements
Rank 2
answered on 07 Jan 2011, 03:00 PM
Hello,

I am using the latest SP1 Q3 2010. Is this what you mean by fixed? (see screenshot)
Richard
0
erwin
Top achievements
Rank 1
Veteran
Iron
answered on 07 Jan 2011, 06:22 PM
I cannot reproduce an unhandled exception with that filter pattern on 2010Q3SP1 anymore.

The grid should allow any characters in the filter text box. It should just not throw an exception on some characters and should escape/quote special characters internally so that they do not interfere with the underlying filter engine.

Richard, I would say that your screenshot shows the expected result.

regards
Erwin
0
Achuthan
Top achievements
Rank 1
answered on 10 Jan 2011, 06:45 AM
Okay, I posted in the wrong forum. Came from google search and posted in Winforms forum. Actually I'm working on Asp.Net Ajax.
Tags
GridView
Asked by
Julian Samuel
Top achievements
Rank 1
Answers by
Jack
Telerik team
Achuthan
Top achievements
Rank 1
Richard Slade
Top achievements
Rank 2
erwin
Top achievements
Rank 1
Veteran
Iron
Share this question
or