set Postback false to GridFilterMenuItem

4 posts, 0 answers
  1. Avelyn Teh
    Avelyn Teh avatar
    10 posts
    Member since:
    May 2010

    Posted 29 Apr 2011 Link to this post

    Hi all,

    Please help!
    Is there any way to disable postback at GridFilterMenuItem ?
    I already tried as below but it doesn't work. 
    Even Postback value always show 'False' at runtime my grid still postback when I select FilterMenuItem.

    <FilterMenu EnableEmbeddedScripts="True" >
      <DataBindings><telerik:RadMenuItemBinding PostBack="false"/>
    </FilterMenu >
    Dim menu As GridFilterMenu = RadGrid1.FilterMenu
    For Each item As RadMenuItem In menu.Items
        Dim a As String = item.Text
        item.PostBack = False
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 30 Apr 2011 Link to this post

    Hello Avelyn,

    One suggestion is to ajaxifying RadGrid which will prevent all postbacks.

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"  />
    <telerik:RadGrid ID="RadGrid1"  runat="server">
        .   .   .   .   .   .  .

  3. Avelyn Teh
    Avelyn Teh avatar
    10 posts
    Member since:
    May 2010

    Posted 03 May 2011 Link to this post

    Hi Princy,

    Thank you for your suggestion.
    I have already used RadAjaxManager from the begining.

    May be I've posted wrong question.
    Here is my scenario
    The grid will not populate and show result each time when user selected filterfunction from filtermenuitem after they have enter in filterbox.
    User may enter more than one columns and select filterfunction for each colum.
    After all, user will click command button on <CommandItemTemplate> then just show the result.
    Means filtering with multiple columns at just one button click.

    Recently the grid populate and show result every time when user select filtermenuitem.


  4. Iana Tsolova
    Iana Tsolova avatar
    3388 posts

    Posted 06 May 2011 Link to this post

    Hi Avelyn,

    The desired functionality is not supported by RadGrid out of the box. To implement it, you will need do it all manually. For instance, you can cancel the filter command in the OnCommand client-side event to prevent the postback. However, you will need to save in a hidden field which column are to be filtered and what are there filter functions and value. Then when you go to the server, you will need to set the CurrentFilterValue and CurrentFilterFunction for each column and build the RadGrid FilterExpression manually. For more information on how to work woth the filter expression, you can check the below articles:

    Therefore I would suggest that you use RadFilter with your RadGrid. RadFilter allows you to build  complex filter expression and then apply them on a single button click. Check out this demo to see how easy it is.

    Another option is to use RadListView instead of RadGrid. Because the RadListView server API allows you to add multiple FilterExpressions at once. Find the below resources for a reference:

    I hope this helps.

    All the best,
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top