Bonjour...
Je vous explique mon problème...
Sur une page, j'ai un dropdownlist, une "datagrid" (infragistics)... et quelque autre truc non important pour mon problème..
La "DataGrid" est un UserControl... Elle utilise son ID pour savoir quoi charger...
je voudrais que lorsque je change de selection dans mon dropdownlist, je charge une aurte grille..
Le problème est que pour que toute mes fontions de la grille (Fonction Ajax) du genre paging, filtering, sorting
fonctionne, il faut que toute la grille soit chargée lors du Page_Init..
Monproblème est que l'événement SelectedIndexChanged de mon dropdownlist est déclanché trop tard....
voici le squelette de ma page et de mon usercontrol.... merci encore pour votre aide..
Mon user control:
public partial class WebControl_WebGrid : System.Web.UI.UserControl
{
protected void Page_Init(object sender, EventArgs e)
{
this.UltraWebGrid.InitializeDataSource += new Infragistics.WebUI.UltraWebGrid.InitializeDataSourceEventHandlerUltraWebGrid_InitializeDataSource);
this.UltraWebGrid.InitializeLayout += new Infragistics.WebUI.UltraWebGrid.InitializeLayoutEventHandler(UltraWebGrid_InitializeLayout);
this.UltraWebGrid.InitializeRow +=new Infragistics.WebUI.UltraWebGrid.InitializeRowEventHandler(UltraWebGrid_InitializeRow);
}
protected void UltraWebGrid_InitializeDataSource(object sender, Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs e)
{
LoadGrid();
this.UltraWebGrid.Browser = Infragistics.WebUI.UltraWebGrid.BrowserLevel.Xml;
this.UltraWebGrid.DisplayLayout.LoadOnDemand = Infragistics.WebUI.UltraWebGrid.LoadOnDemand.Xml;
this.UltraWebGrid.DisplayLayout.Pager.AllowPaging = true;
this.UltraWebGrid.DisplayLayout.Pager.PageSize = 100;
}
protected void UltraWebGrid_InitializeLayout(object sender, Infragistics.WebUI.UltraWebGrid.LayoutEventArgs e)
{
//ICI je traite les collone que je veux montrer ou pas...
//active le filtering
}
}
Ma Page:
public partial class Statistics_Extract_Default : System.Web.UI.Page
{
protected void Page_Init(object sender, EventArgs e)
{
this.cboLists.SelectedIndexChanged +=new EventHandler(cboLists_SelectedIndexChanged);
}
protected void cboLists_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
this.WebGrid.ID = "stat" + this.cboLists.Text;
}
}
}