[CLOSED] setValue for FilterHeader in code behind

  1. #1

    [CLOSED] setValue for FilterHeader in code behind

    Hi,

    In the example https://examples2.ext.net/#/GridPane...ader/Overview/ there is a button where a filter is set.
    Is it possible to use setValues in the C# or VB code just like in this javascript code?

    I tried somthing like the following code but no success:
     protected void btnLoadFilter_Click(object sender, EventArgs e)
        {
            Dictionary<string, object> dict1 = new Dictionary<string, object>();
            dict1.Add("Company", "!Inc.");
            dict1.Add("Visible",1);
            filterheader.SetValue(dict1);
            filterheader.ApplyFilter();
        }
    May be my idea to get this done is too simple?

    Purpose is to apply this in an application where I combined a Gridfilter with Infinite scrolling. Data come from a mySQL database table and is bound in the pageload. But it is also neccesary to insert records. After inserting a record and binding the data again the filter is cleared. So I want to re-apply the filter.

    Hans
  2. #2
    Hi

    I tried your code snippet and it works for me. SetValue method works fine and ApplyFilter is not required in this case
  3. #3
    Hi Vladimir,

    You're right: it works.
    Sorry, my mistake. Normally I add a click handler with:
    <DirectEvents>
       <Click OnEvent="btnLoadFilter_Click"></Click>
    </DirectEvents>
    But this time I took OnClick= "btnLoadFilter_Click" in the ext:Button.
    That should be OnDirectClick.

    The issue of getting the data filtered after inserting a new record and binding the data again could be implemented by adding

    filterheader.ApplyFilter();

    Thanks, Hans
    Last edited by HansWapenaar; Aug 04, 2014 at 3:07 PM.

Similar Threads

  1. [CLOSED] Filterheader and getRowsValues
    By leonardm in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 26, 2014, 5:53 AM
  2. [CLOSED] TagField Code Behind setValue
    By rsnead in forum 2.x Legacy Premium Help
    Replies: 11
    Last Post: Feb 16, 2014, 3:28 PM
  3. [CLOSED] FilterHeader Plugin Error
    By leonardm in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Aug 21, 2013, 4:53 PM
  4. Replies: 4
    Last Post: Jul 17, 2013, 2:10 PM
  5. whats wrong in this code ? error in setValue property!
    By jhenriquecosta in forum 2.x Help
    Replies: 1
    Last Post: Jan 29, 2013, 5:06 PM

Posting Permissions