AfeterDataRefresh

Originally Posted 30 March 2017, 8:30 am EST

  • Originally Posted 30 March 2017, 8:30 am EST

    Hi,
    while an AfterDataRefresh event from a C1FlexGrid is raised only once when SQL Server bounded data are retrieved, i've noticed that the AfterDataRefresh event raised from a C1FlexPivotGrid is raised many time depending on how many rows are created.
    Is this behaviour correct?
    How can I get the real number of rows added to the PivotGrid programmatically?
    At the moment, as a workaround, i wait for the C1FlexGrid AfterDataRefresh event to proceed with other code; i need to proceed with those other lines directly from C1FlexPivotGrid' AfterDataRefresh event.
    I think that this behaviour can easily reproduced in any way.
    Thanks

    Regards,
    Fabio La Vitola
  • Reply

    Hi Fabio La Vitola,

    AfterDataRefresh event from a C1FlexGrid is not raised depending on how many rows are created. It gets fired whenever there is a change in the used DataSource.
    http://helpcentral.componentone.com/nethelp/c1flexgrid/C1.Win.C1FlexGrid.4~C1.Win.C1FlexGrid.C1FlexGridBase~AfterDataRefresh_EV.html
    You can get the number of rows added in the grid using c1FlexPivotPage.FlexPivotGrid.Rows.Count property. It will return the number of rows that are currently available in the C1FlexGrid of C1FlexPivotPage.

    Hope it helps.

    Thanks,
    Akshay
  • Reply

    @Akshay_Madan said:
    Hi Fabio La Vitola,

    AfterDataRefresh event from a C1FlexGrid is not raised depending on how many rows are created. It gets fired whenever there is a change in the used DataSource.
    http://helpcentral.componentone.com/nethelp/c1flexgrid/C1.Win.C1FlexGrid.4~C1.Win.C1FlexGrid.C1FlexGridBase~AfterDataRefresh_EV.html
    You can get the number of rows added in the grid using c1FlexPivotPage.FlexPivotGrid.Rows.Count property. It will return the number of rows that are currently available in the C1FlexGrid of C1FlexPivotPage.

    Hope it helps.

    Thanks,
    Akshay

    Hi Akshay,
    i did noticed the difference beteww the two kinda AfterDataRefresh (Pivot has the event parametrr "e as ListChangedEventArgs), but i need to know how may rows are available only after the rows creation process is finished.
    I nee somthing synchronous, otherwise i cannot identify the point to insert my code, which expects data fill has finished.
    That's why i did mention the AfterDataRefresh from standard FlexGrid.
    I suggest to add something like "DataComplete = 8" in the ListChangedType enum of the e.ListChangedType; this new value (another raise) will advice about the competion of pivot rows creation!
    Anyway, checking c1FlexPivotPage.FlexPivotGrid.Rows.Count (i.e. into AfterDataRefresh event) won't help 'cause when i add totals/subtotals, then grid is regenerated and raises every time an incremental row number.
    I need (and i think I won't be the only one) to know when exaclty the parsing and rendering of pivot rows into the FlexPivotGrid is completed: int his case i'll be able to go on with other code (i.e. in my case, an advanced report generation).
    Hoping that i've been clear enough!

    Thanks

    Regards,
    Fabio
  • Reply

    Hi Fabio,

    You can use C1FlexPivotPage.FlexPivotGrid.Rows.Count in Updated event of C1FlexPivotPage to get the total rows added initially.
    Below is the code:
    private void _c1FlexPivotPage_Updated(object sender, EventArgs e)
    {
    if (_c1FlexPivotPage.FlexPivotGrid.Rows.Count > 1)
    MessageBox.Show(_c1FlexPivotPage.FlexPivotGrid.Rows.Count.ToString());
    }

    Please let me know if there is any difference in my understanding.

    Thanks,
    Akshay
  • Reply

    @Akshay_Madan said:
    Hi Fabio,

    You can use C1FlexPivotPage.FlexPivotGrid.Rows.Count in Updated event of C1FlexPivotPage to get the total rows added initially.
    Below is the code:
    private void _c1FlexPivotPage_Updated(object sender, EventArgs e)
    {
    if (_c1FlexPivotPage.FlexPivotGrid.Rows.Count > 1)
    MessageBox.Show(_c1FlexPivotPage.FlexPivotGrid.Rows.Count.ToString());
    }

    Please let me know if there is any difference in my understanding.

    Thanks,
    Akshay

    Hi Akshay,
    the prob is that i use FlesPivotGrid and FlexPivotPanel...
    And since PivotFlex grid is asyncronous, even after update i cannot get the last number of rows & Cols.
    For example, i've changed the actual event
    Private Sub C1flxPivotPanel_Updated(sender As Object, e As EventArgs) Handles C1flxPivotPanel.Updated

    from

    C1flxGrigliaPivot.AutoSizeRows()

    to

    MsgBox(C1flxGrigliaPivot.Rows.Count.ToString + vbTab + C1flxGrigliaPivot.Cols.Count.ToString)

    It appears many times, and every time it apperas it contains a different (incremntal) number of rows & COls...

    Until a SYNC event won't be created, it will be difficult to catch the correct case once i really have the pivot filling data completed!

    Thanks

    Regards
    Fabio
  • Reply

    Hi Fabio,

    Thanks for providing the information.

    I am discussing it with the concerned team (Tracking ID: 252642) and will get back to you as soon as there is any information from them.

    Thanks,
    Akshay
  • Reply

    Thanks Akshay,
    i'll wait for more news asap.

    Regards,
    Fabio
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels