Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Este control permite mostrar en un formulario un GRID de forma automática, mostrando las columnas y registros resultados de un Stored Procedure.

Navegación

Pre condiciones

Guía paso a paso

Paso 1.

En la pantalla actual seleccionar el tipo de control Dynamic Grid y presionar el botón New.

...

Paso 2.

En la ventana Pop Up se deben ingresar los datos que crearan el control

...

General

  • Field. Nombre interno que se le asigna al control, Ejemplo: ID (NOTA: Este control debe llamarse igual que el campo que regresa el DataSet en SQL)

  • Comment. Puede ingresar un comentario adicional acerca del control

...

Data Binding

  • DataSet de Relleno: Permite seleccionar un DataSet para poder obtener las opciones del Combo.

  • DataSet. Si el GRID se llenara por medio de un DataSet en este campo se debe seleccionar.

...

Layout

  • Place Holder. Son los contenedores del Layout

  • Order. Es el orden en el cual se debe mostrar el control en la página.

...

Condicional

  • Visible. Atributo que indica si la columna será visible o no. También puede ser condicionada y únicamente será mostrada al cumplir con la condición.

Paso 3.

Después de capturar las características necesarias para el Dymanic Grid se hace click en el botón Accept para guardar los cambios.

...

Overview

In this lesson, we will learn how to create a “Dynamic Grid” control under the page. This option allow us to generate multiple columns in a grid without spending a lot of time using the “Grid Column” controls for each column that we want to display on the page. This is an easy way to make an association between the tables or stored procedures previously generated in Database to print the registers in the application.

How to create a Stored Procedure and a new Dataset for “Dynamic Grid” control ?

As precondition to create a “Dynamic Grid” control, we need to connect to the Database in SQL and create a new Stored Procedure like we did in previous lessons.

Open a new query and create a procedure with 3 columns “Description”, “Latitude” and “Longitude”:

Code Block
CREATE TABLE [dbo].Hola_Mundo_Edificios(
Description	nvarchar(300),
Latitude	nvarchar(300),
Longitude	nvarchar(300),
ID			int
)

CREATE PROCEDURE [dbo].[SP_Hola_Mundo_Edificios]
AS
  BEGIN
   SELECT 500 Description,Latitude,Longitude FROM Hola_Mundo_Edificios
  END

Execute the query and then turn to Wayfast.

Select any page from the project and focus on “Dataset” section

...

Notice that there’s no element associated to the page. Click on “New Dataset” button to create a new one that will contain the information from the Stored Procedure.

...

Complete the “General” tab with the basic information to identify the dataset. Turn to “Data Binding” tab

...

Select the “Stored Procedure” type and look for the one created in SQL for this purpose. Once the “Instance” match with the one used in DB to create the procedure, we can establish the proper relationship in Wayfast. Click on “Submit” button save the changes.

...

If we edit the dataset and focus on “Columns” tab, you can observe that the same 3 columns are generated automatically in Wayfast at the Dataset:

...

How to create a “Dynamic Grid” control?

Now that we generated the preconditions, we can easily create the “Dynamic Grid” control by selecting the control and click on “New” button in the same page that we worked on.

...

A popup is displayed to complete the details on “Dynamic Grid” control. Make sure that the control is properly identified at “General” tab.

...

Then click on “Data Binding” tab

...

Since we created a dataset on this page, we will see the option displayed in the dropdown list. This reference will link the stored procedure data, the dataset and finally the control itself.

Include the “Layout” information and click on “Submit” to complete the process

...

Not that the setup is completed, let’s click on “Preview” button to verify that the “Dynamic Grid” control is showing all the columns and data retrieved from the stored procedure.

...

Recap

This control give us the possibility to create a grid in our pages by just connecting the stored procedure, and the most important thing to keep in mind, there’s no need to create multiple “Grid Column” controls for each column in grid.

We made a big progress in Wayfast learning path, the basic controls that we learned in the beginning are now making contact to new and more complex controls that allow to collect the information and display it on the pages in a more simple way.