Author Topic: Filter a secondary from a client script  (Read 2644 times)

Offline Rommel

  • Full Member
  • ***
  • Posts: 35
  • Karma: +0/-0
  • Gender: Male
  • forza AC MILAN
    • View Profile
Filter a secondary from a client script
« on: March 13, 2007, 10:27:25 AM »
I have a filtered secondary in a form, but i still need to filter this scondary on client side by clicking a button and choose a filter criteria.
in other words i need to do exactly as pivotal out-of-box Advanced search functionality, to allow user to choose a field from that secondary and enter a certain value, then click a button which results in filtering the secondary.

What i have done so far is getting record set of the secondary, go to MT, filter that record set, return to client side with filtered record set.

My problem is how to show only filtered records in the secondary.

i am not aware if there is a function or moethod to set Secondry = Filtered Record set

Please HELP!!!!!!   ???


Offline jaybee

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 125
  • Karma: +12/-0
  • Gender: Male
  • Up the irons !
    • View Profile
Re: Filter a secondary from a client script
« Reply #1 on: December 10, 2014, 06:06:38 AM »
A little bit late, but that will do the trick :
Code: [Select]
        private void ApplySecondaryRowFilterClause(string sFilteredSecondaryName, string sWhereClause)
            CdcSoftware.Pivotal.Engine.UI.Forms.PivotalSecondary pivControl
                = this.FormControl.GetControlByName(sFilteredSecondaryName) as CdcSoftware.Pivotal.Engine.UI.Forms.PivotalSecondary;

            CdcSoftware.Pivotal.WindowsFormControls.PivotalSecondary winControl = pivControl.WindowsControl as CdcSoftware.Pivotal.WindowsFormControls.PivotalSecondary;

            System.Data.DataView dataView = (winControl.DataSource as System.Data.DataView);

            if (dataView != null)
                dataView.RowFilter = sWhereClause;
                winControl.DataSource = dataView;