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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...