# Create a table or grid view with multiple rows

**URL:** <https://discuss.workflowgen.com/t/create-a-table-or-grid-view-with-multiple-rows/1995>\
**Category:** Process Design\
**Created:** [January 31, 2022, 3:45pm UTC](https://discuss.workflowgen.com/t/create-a-table-or-grid-view-with-multiple-rows/1995 "2022-01-31T15:45:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bertrand](https://avatars.discourse-cdn.com/v4/letter/b/a88e4f/32.png) [@Bertrand](https://discuss.workflowgen.com/u/Bertrand)\
**Post date:** [January 31, 2022, 3:45pm UTC](https://discuss.workflowgen.com/t/create-a-table-or-grid-view-with-multiple-rows/1995/1 "2022-01-31T15:45:20Z")

</div>

Hello,  
I would like to create a table or grid view with multiple rows that can be populated with text or an input box, or a drop down list.  
Thanks for your help.

---

<div class="post-metadata">

**Author:** ![nvarlet](https://avatars.discourse-cdn.com/v4/letter/n/a8b319/32.png) [@nvarlet](https://discuss.workflowgen.com/u/nvarlet)\
**Post date:** [February 3, 2022, 2:58pm UTC](https://discuss.workflowgen.com/t/create-a-table-or-grid-view-with-multiple-rows/1995/2 "2022-02-03T14:58:25Z")

</div>

Bonjour,  
Voici le code que j’utilise pour alimenter mon tableau (méthode de click sur un bouton puis alimentation du tableau en lui même)  
L’exemple prend un tableau à 3 entrées avec 1 liste déroulante et 2champs textes qui permettent de l’alimenter. Ces zones sont en dehors du tableau.

```auto

    // Bouton d'ajout d'un rattachement moteur
    protected void BtnAddNewLineClick(object sender, EventArgs e) 
    {
        AddLineToRattachement(S_SAISIR_ListeD.SelectedValue,S_SAISIR_T_TXT1.Text,S_SAISIR_T_TXT2.Text);

        // Sauvegarde du form data + init des valeurs
        this.SaveFieldsData(this.FormData);
		this.SaveFormData(this.FormData);
		this.BindFormDataToFields(this.FormData);
		S_SAISIR_ListeD.SelectedValue = "";
		S_SAISIR_T_TXT1.Text = "";
		S_SAISIR_T_TXT2.Text = "";

    }

```

```auto
// Méthode d'ajout d'une ligne dans un tableau
protected void AddLine(string i_field1, string i_field2, string i_field3)
    {
        int column1 = 0;
        int column2 = 1;
        int column3 = 2;
        System.Data.DataRow row = this.FormData.Tables["S_SAISIR_GRID_VIEW"].NewRow();
        row[column1] = i_field1;
        row[column2] = i_field2;
        row[column3] = i_field3;
     	this.FormData.Tables["S_SAISIR_GRID_VIEW"].Rows.Add(row);
 	    this.FormData.Tables["S_SAISIR_GRID_VIEW"].AcceptChanges();
    }

```

- J’ai changé le nom des variables.  
Cdlt
