Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control Refresh() Method
Message
De
08/07/2004 01:45:59
 
 
À
08/07/2004 01:35:28
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00921607
Message ID:
00921840
Vues:
23
Darn, wouldn't you know it would be a question that I don't have an answer for off the top of my head. I haven't used .Find(), so I have no practical experience with it and, as it's late and I'm ready to hit the sack, I don't have time to research it right now. The "correct" way to move to the right row would be to mess with the BindingContext[].Position, but I don't know if there's a built-in way to get there when using the .Find() or not.

Sorry I can't be more help right now. If you haven't figured out another way by tomorrow (or if someone else doesn't suggest something), perhaps I can take a quick look at it in the morning. Sorry. =(

~~Bonnie


>>>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 :)
>
>
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform