Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control Refresh() Method
Message
De
08/07/2004 01:35:28
 
 
À
08/07/2004 01:30:57
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00921607
Message ID:
00921838
Vues:
19
>>Bonnie,
>>
>>Are you able to answer another quick question?
>
>OK ... shoot

Here is a method in my non-realworld form I'm playing with. Same listbox bound to the same DataSet as before. The goal being that I want to move the listbox to reflect the find. This method shouldn't know or care about what listbox is bound to it, but I can't figure out how to actually get the Find() method to move to the row in question.
private void FindCity(string cityName)
// todo:  add second parameter (bool) to determine whether or not to move pointer
//      and change return type to bool
{
	DataRow oRow;
			
	oRow = (DataRow) dsCities.Tables["Cities"].Rows.Find(cityName);
			
	if (oRow == null)
		MessageBox.Show(cityName + " not found");
	else
	{
		// don't want to resort to this to move the selection in the listbox...		
		lbCities.SelectedValue = oRow["Name"];
			
	}

}
Any ideas? Thanks :)


Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform