systemic_anomaly
Messages postés59Date d'inscriptionvendredi 16 janvier 2004StatutMembreDernière intervention 1 août 2005
-
9 mai 2005 à 11:01
cs_stailer
Messages postés507Date d'inscriptionjeudi 28 mars 2002StatutMembreDernière intervention13 mai 2009
-
9 mai 2005 à 15:20
Bonjour tt le monde,
J'ai un tableau (Web form, pas HTML) constitué à la base de 4 rows chacunes ayant 2 cellules qui se construit sur base d'un autre tableau déclaré static... (car mon tableau se réinitialisait à chaque page load se qui posait problème et c'est la seul solution que j'ai trouvé. déjà posté ici mais aucune réponse ne m'a aidé).
Pour chaque row: cell[0] = label
cell[1] = dropdownlist
J'ai associé un évènement à cette dropdownlist mais il ne se déclenche que si je refais le tableau à chaque page load (ce que je ne veux pas évidemment).
Voici le code (j'essaie de ne mettre que ce qui nous interesse):
//Construct rows and cells for free text search
ConstructFreeTextSearch();
//Construct rows and cells for skill search
ConstructSkillSearch();
//Construct rows and cells for field search
ConstructFieldSearch();
//Construct rows and cells for variable field search
ConstructVariableFieldSearch();
for (
int i=0;i<TableMenu.Rows.Count;i++)
{
TableMenuCriteria.Rows.Add(
new TableRow());
NumberOfCells = TableMenu.Rows[i].Cells.Count;
for (
int j=0;j<NumberOfCells;j++)
{
TableMenuCriteria.Rows[i].Cells.Add(
new TableCell());
TableMenuCriteria.Rows[i].Cells[j].Controls.Add(TableMenu.Rows[i].Cells[j].Controls[0])
}
}
}
}
/// <summary>
/// Construct rows and cells for the free
/// text search
/// </summary>
private
void ConstructFreeTextSearch()
{
TableMenu.Rows.Add(
new TableRow());
TableMenu.Rows[0].Cells.Add(
new TableCell());
TableMenu.Rows[0].Cells[0].Controls.Add(ConstructLabel("Free text : "));
TableMenu.Rows[0].Cells.Add(
new TableCell());
TableMenu.Rows[0].Cells[1].Controls.Add(ConstructDropDownListFieldForFreeText());
}
/// <summary>
/// Construct a dropdownlist initialized with
/// the searchable field for free text
/// </summary>
/// <returns> DropDownList </returns>
/!\ VOILA L'ENDROIT OU J'AJOUTE L'EVENEMENT A LA DROPDOWN QUI SERA AJOUTEE A
UNE CELLULE DU TABLEAU.
aDropDownListFieldForFreeText.SelectedIndexChanged +=
new EventHandle (aDropDownListFieldForFreeText_SelectedIndexChanged);