[CLOSED] How to set gridfilter from code

  1. #1

    [CLOSED] How to set gridfilter from code

    Hi,

    can't figure out how to set initial gridfilter value (stringfilter) from code (server)..

    Could you give a small example ?

    Martin
    Last edited by Daniil; Nov 27, 2012 at 4:00 AM. Reason: [CLOSED]
  2. #2
    Hi Martin,

    Please use StringFilter's Value property.
    StringFilter f = new StringFilter();
    f.Value = "initial value";
  3. #3
    Quote Originally Posted by Daniil View Post
    Hi Martin,

    Please use StringFilter's Value property.
    StringFilter f = new StringFilter();
    f.Value = "initial value";
    I'm not creating the filters in code but I can do that offcourse. But just wondering how to set the initial value when having this:

    <ext:GridFilters runat="server" ID="gfIssues" Local="true">
                                    <Filters>
                                        <ext:NumericFilter DataIndex="ID" />
                                        <ext:StringFilter DataIndex="cIssueSoort" />
                                        <ext:StringFilter DataIndex="cGroep" />
                                        <ext:StringFilter DataIndex="cTitel" />
                                        <ext:NumericFilter DataIndex="nKlantID" />
                                        <ext:StringFilter DataIndex="clNaamContact" />
                                        <ext:StringFilter DataIndex="cPakket" />
                                        <ext:StringFilter DataIndex="cTags" />
                                        <ext:StringFilter DataIndex="cBuildNummer" />
                                        <ext:DateFilter DataIndex="nDatumAanmaak" AutoDataBind="true">
                                            <DatePickerOptions runat="server" Format="dd-MM-yyyy" TodayText="Now" />
                                        </ext:DateFilter>
                                        <ext:StringFilter DataIndex="nTijd" />
                                        <ext:StringFilter DataIndex="cClusterNaam" />
                                    </Filters>
                                </ext:GridFilters>
    I can't set an ID for the filters, so how can I get the right filter. Only by index ?

    And also..how to set the numericfilter value (as this property is non existing) ?

    Martin
    Last edited by CarWise; Nov 26, 2012 at 12:02 PM.
  4. #4
    Quote Originally Posted by CarWise View Post
    I can't set an ID for the filters, so how can I get the right filter. Only by index ?
    Or search for DataIndex. Maybe, it would be better to just add a StringFilter instance with all required setting to the Filters collection.

    Quote Originally Posted by CarWise View Post
    And also..how to set the numericfilter value (as this property is non existing) ?
    There are the EqualValue, GreaterThanValue and LessThanValue properties at your service.
  5. #5
    Quote Originally Posted by Daniil View Post
    Or search for DataIndex. Maybe, it would be better to just add a StringFilter instance with all required setting to the Filters collection.



    There are the EqualValue, GreaterThanValue and LessThanValue properties at your service.
    duh.. sorry .. was really looking for a value property that doesn't exist ofcourse.. :[ (wake up Martin)

    What is the reason btw that there is no possibility to add an ID to a gridfilter (just curious)

    Martin
  6. #6
    Quote Originally Posted by CarWise View Post
    What is the reason btw that there is no possibility to add an ID to a gridfilter (just curious)
    Well, it is not a real control. Just a class to get some JavaScript in the output.
  7. #7
    Quote Originally Posted by Daniil View Post
    Well, it is not a real control. Just a class to get some JavaScript in the output.
    Thanx for the info Daniil. Next time I will drink some coffee before asking you for a property that doesn't exist :)

    martin

Similar Threads

  1. Set gridfilter on Page_Load
    By ETICS in forum 2.x Help
    Replies: 0
    Last Post: Oct 04, 2012, 1:28 PM
  2. GridFilter Position
    By sachin.munot in forum 1.x Help
    Replies: 14
    Last Post: Aug 16, 2010, 12:13 PM
  3. GridFilter
    By flaviodamaia in forum 1.x Help
    Replies: 2
    Last Post: May 05, 2009, 1:26 PM
  4. [CLOSED] Gridfilter Error
    By speedstepmem4 in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Dec 10, 2008, 12:25 AM
  5. [FIXED] [V0.7.0] GridFilter Bug
    By Timothy in forum Bugs
    Replies: 4
    Last Post: Oct 07, 2008, 3:43 PM

Posting Permissions