Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Control Refresh() Method
Message
De
08/07/2004 10:47:20
 
 
À
08/07/2004 02:12:01
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00921607
Message ID:
00921998
Vues:
21
Steve,

Looks like you found the solution (after I went to bed last night I thought that I should have mentioned rolling your own by iterating through the rows, so yeah, it's a good way to do it). And you've gotten good feedback from Kevin and Danny. Looks like my job is done. <g>

~~Bonnie

>>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.
>
>Okay, here's a generalized solution that I'm going to go with, until I figure out otherwise. Haven't tested it for non-string key values yet, but it should work out.
>
>I really appreciate your help...it means a lot on my C# crash course. :)
>
>
>private bool MoveBindingPosition(DataTable oTable,
>                                     string fieldName, object lookupValue)
>{
>
>   bool Found = false;
>   int i = 0;
>
>   foreach (DataRow oRow in oTable.Rows)
>   {
>      if (oRow[fieldName].ToString() == lookupValue.ToString())
>      {
>         Found = true;
>         this.BindingContext[oTable].Position = i;
>         break;
>      }
>      i++;
>   }
>		
>   return Found;
>
>}
>
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