|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Fonction de recherche dans un datagridVoici mon problème, J'ai fait une petite fonction de recherche pour un datagrid. Mon problème est que si je ne suis pas positionné à la page un du DataGrid. la fonction de recherche me retourne un message d'erreur. Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount Merci d'avance !! Esperanza Here it goes : //****************************************************** private void btnRecherche_Click(object sender, System.EventArgs e) { string strVar; string strSelection; strVar = this.txtRecherche.Text; strSelection = this.RadListSearch.SelectedItem.Text; try { if (strVar.Trim()!=null) { switch(strSelection) { //Recherche par nom case "Nom": this.dataViewGPPL.RowFilter = "XABALPH like '%" + strVar + "%'"; break; //Recherche par no Téléphone case "No tel.": this.dataViewGPPL.RowFilter = "XTEL like '" + strVar + "'"; break; }//fin du switch //faire le bind this.sqlCommandGPPL.Parameters["@GLNOTECH"].Value = Session["Client_TECH_RDV"]; this.sqlDataAdapGPPL.Fill(dataSet11); this.DataGrid1.DataSource = dataViewGPPL; this.DataGrid1.DataBind(); }//fin du if }//fin du try catch (Exception ex) { throw ex; } } Premièrement, vous devriez poser votre question dans un des groupes de
discussion francophones. Deuxièmement, la valeur CurrentPageIndex ne fait pas partie de l'extrait de code présenté; difficile de voir alors d'où pourrait provenir le problème. S. L. Show quoteHide quote "Esperanza" <esperanza***@hotmail.com> wrote in message news:%232E9TCNKFHA.1948@TK2MSFTNGP14.phx.gbl... > Bonjour .net expert !! > Voici mon problème, > > J'ai fait une petite fonction de recherche pour un datagrid. > Mon problème est que si je ne suis pas positionné à la page un du > DataGrid. > la fonction de recherche me retourne un message d'erreur. > > > Invalid CurrentPageIndex value. It must be >= 0 and < the PageCount > > > Merci d'avance !! > Esperanza > > Here it goes : > > //****************************************************** > private void btnRecherche_Click(object sender, System.EventArgs e) > { > > string strVar; > string strSelection; > strVar = this.txtRecherche.Text; > > strSelection = this.RadListSearch.SelectedItem.Text; > > try > { > if (strVar.Trim()!=null) > { > > switch(strSelection) > > { > //Recherche par nom > case "Nom": > this.dataViewGPPL.RowFilter = "XABALPH like '%" + strVar + "%'"; > break; > > //Recherche par no Téléphone > case "No tel.": > this.dataViewGPPL.RowFilter = "XTEL like '" + strVar + "'"; > break; > > }//fin du switch > > //faire le bind > this.sqlCommandGPPL.Parameters["@GLNOTECH"].Value = > Session["Client_TECH_RDV"]; > this.sqlDataAdapGPPL.Fill(dataSet11); > > this.DataGrid1.DataSource = dataViewGPPL; > this.DataGrid1.DataBind(); > > }//fin du if > > > }//fin du try > > > catch (Exception ex) > { > throw ex; > } > > > } > > > > > Voici un des groupes de discussion francophones dont Sylvain parlait:
microsoft.public.fr.dotnet.aspnet Show quoteHide quote "Esperanza" <esperanza***@hotmail.com> wrote in message news:%232E9TCNKFHA.1948@TK2MSFTNGP14.phx.gbl... > Bonjour .net expert !! > Voici mon problème, >
Searched Datagrid with Paging?
Using Server.Transfer with HyperLinkColumn in a datagrid 5th Re-Post with NO RESPONSE FROM MS! Questions concerning detailsview or datagrid ASP.NET 2.0 How to capture CheckChanged event from Radiobutton in Datagrid? Problem with Top And Bottom Paging radiobutton and datagrid Make links different color in the datagrid search function on different page selected Handling events for Checkbox in Data Grid |
|||||||||||||||||||||||