Jump to content

Forzar el Scroll en un UniStringGrid (RESUELTO)


Luis Devis

Recommended Posts

Hola , mi problema es que a medida que voy añadiendo rows a mi unistringgrid la pantalla no cambia, necesito que el usuario pueda ver la última línea que ha insertado , puedo situar el row en la ultima línea pero en pantalla no se hace scroll y no puede verse esa ultima línea.

¿Alguna sugerencia?

Gracias

Link to comment
Share on other sites

  • Luis Devis changed the title to Forzar el Scroll en un UniStringGrid (RESUELTO)

Solución en dos pasos : El tUniStringgrid se llama Grid

1º En Grid.ClientEvents.UniEvents -> AfterCreate   Escribir

function afterCreate(sender)
{
  let me = sender;
    me.scrollToEnd = function() {
        me.ensureVisible(me.getStore().last())
    }
}

 

2º En el momento deseado (yo lo hago después de haber insertado un nuevo row al final)

      UniSession.Synchronize();
      grid.JSInterface.JSCall('scrollToEnd', []);

 

¡¡ Así de simple !!

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...