Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Go top a specified row in a table
Message
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00957940
Message ID:
00957951
Vues:
19
Kevin,
Thank you for your reply. That is exactly what I needed. While reading your reply I stared remembering that I had read about the binding manager a while ago.
I also read your article in the latest issue of CoDe magazine. I was going to post a thread here on UT saying how much I enjoyed reading your article. Great work Kevin!! Looking forward to more articles from you. Do you have a website where you post articles?

Again thanks for your reply and a memory refresh.

Sincerely,
Einar

>Hey, Einar,
>
>Assuming your datagrid is bound to a datatable, you can access the position property of the grid's binding manager...for example...
>
>
>myGrid.DataSource = myTable;      (or myGrid.DataSource = myTable.DefaultView)
>
>BindingManagerBase bMgr =  myGrid.BindingContext[myGrid.DataSource,myGrid.DataMember];
>bMgr.Position = 0;   // will go to the top
>bMgr.Position = myTable.Rows.Count-1;   // will go to the bottom    (or myTable.DefaultView.Count)
>this.Refresh();
>
>
>And if you want to highlight the row afterwards, you can do a...
>
>
>myGrid.Select(  <row# to highlight>  );
>
>
>Let me know if that helps...
>
>Also...I have an article in the most recent issue of CoDe magazine that covers the Winforms datagrid, and offers some productivity tools for the grid. Here's a link to the first page (you need to be a subscriber to read the entire article):
>
>http://www.code-magazine.com/Article.aspx?quickid=0411081
>
>
>Kevin
Semper ubi sub ubi.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform