Rad grid view filtering

6 posts, 0 answers
  1. Julian Samuel
    Julian Samuel avatar
    1 posts
    Member since:
    Mar 2010

    Posted 02 Sep 2010 Link to this post

    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

  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 07 Sep 2010 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Achuthan
    Achuthan avatar
    31 posts
    Member since:
    May 2007

    Posted 07 Jan 2011 Link to this post

    So is it fixed now? I'm getting unhandled error generated by Radgrid when I filter using the keyword

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

  5. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Jan 2011 Link to this post

    Hello,

    I am using the latest SP1 Q3 2010. Is this what you mean by fixed? (see screenshot)
    Richard
  6. erwin
    erwin avatar
    358 posts
    Member since:
    Dec 2006

    Posted 07 Jan 2011 Link to this post

    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
  7. Achuthan
    Achuthan avatar
    31 posts
    Member since:
    May 2007

    Posted 10 Jan 2011 Link to this post

    Okay, I posted in the wrong forum. Came from google search and posted in Winforms forum. Actually I'm working on Asp.Net Ajax.
Back to Top
UI for WinForms is Visual Studio 2017 Ready