1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| // Si le datagrid génère automatiquement les colonnes et accepte le 'paging'
// Alors le 'paging' est 'fusionner' sur l'ensemble des colonnes
if (this.ResultatDataGrid.AutoGenerateColumns && this.ResultatDataGrid.AllowPaging)
{
Table table = (Table)this.ResultatDataGrid.Controls[0];
// si le paging se trouve en bas du datagrid
if (this.ResultatDataGrid.PagerStyle.Position == PagerPosition.Bottom || this.ResultatDataGrid.PagerStyle.Position == PagerPosition.TopAndBottom)
{
// fusionner l'ensemble des colonnes de la dernière ligne
// là ou se trouver le 'pager'
table.Rows[table.Rows.Count - 1].Cells[0].Attributes.Add("colspan", table.Rows[1].Cells.Count.ToString());
}
if (this.ResultatDataGrid.PagerStyle.Position == PagerPosition.Top)
{
// fusionner l'ensemble des colonnes de la 1ère ligne
// là ou se trouver le 'pager'
table.Rows[0].Cells[0].Attributes.Add("colspan", table.Rows[1].Cells.Count.ToString());
}
} |