You can enclose your code within:
gridObj.BeginEdit() and gridObj.EndEdit() to add rows without the need to
refresh ppg. It should reflect the changes immediately and is faster.


On Mon, Oct 28, 2013 at 9:31 AM, Guillaume Laforge <
guillaume.laforge...@gmail.com> wrote:

> Hi Guys,
>
> I've got a custom property with a grid widget. I'm using the Softimage
> 2014 new "OnContextMenuSelected" attribute to call a function that can
> add some rows to the grid.
> It is working fine except for the refresh. I need to re-inspect the
> property to see the added rows.
>
> I'm using ctxt.PutAttribute(L"Refresh", true); as explained in the doc but
> with no luck so far...
>
> Here is a code snippet of what I'm doing:
>
>
> SICALLBACK MyPSet_PPGEvent( const CRef& in_ctxt )
> {
>   PPGEventContext ctxt( in_ctxt );
>   PPGEventContext::PPGEvent eEventID = ctxt.GetEventID();
>   switch ( eEventID ) {
>
>     case PPGEventContext::siGridDataOnContextMenuSelected:
>     {
>       CValueArray extraParams = ctxt.GetAttribute("ExtraParams");
>       LONG selectedMenuID = extraParams[1];
>
>       switch(selectedMenuID)
>       {
>         case DO_THAT:
>           doThat();
>         break;
>         case DO_THIS:
>           doThis();
>         break;
>         ...
>         ...
>       }
>
>       GridData grid = ctxt.GetSource();
>       // This function will add rows and put new values in the GridData
> object
>       updateGridData(grid);
>       // Refresh should update the PPG to display the new lines, but it
> doesn't :(
>       ctxt.PutAttribute(L"Refresh", true);
>     }
>     break;
>   }
> }
>
> Anything wrong in this logic ?
>
> Thanks,
>
> Guillaume
>



--

Reply via email to