Geeks With Blogs

News


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done
Get a Weak or Strong DataTable Row from a selected DataGridView row.
 
Private Sub btnGetDataGridViewSelectedRowData_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetDataGridViewSelectedRowData.Click
 
        '-----------------------------------------------------------------------------------------------------------------------------------
        'Find the first selected row (should only be zero or one since DataGridView1.SelectionMode = FullRowSelect)
        '-----------------------------------------------------------------------------------------------------------------------------------
        Dim row As Integer = DataGridView1.SelectedRows.Count
        Dim selectedRowCount As Integer = _
        DataGridView1.Rows.GetRowCount(DataGridViewElementStates.Selected)
 
        If selectedRowCount <= 0 Then
            MessageBox.Show("First, select a row in the grid above.")
        Else
            '-----------------------------------------------------------------------------------------------------------------------------------
            'Get Weakly Typed DataRow from DataGridView selected Row
            '-----------------------------------------------------------------------------------------------------------------------------------
            Dim myRow As DataRow = DirectCast(DataGridView1.Rows(DataGridView1.SelectedRows(0).Index).DataBoundItem, DataRowView).Row
 
            '-----------------------------------------------------------------------------------------------------------------------------------
            'DataGridView was originally bound to a Strongly Typed DataTable, so get the Strongly Typed DataRow
            '-----------------------------------------------------------------------------------------------------------------------------------
            Dim myStrongRow = CType(myRow, dsStrongDataSet.dtStrongDataTableRow)
 
        End If
 
    End Sub
Posted on Friday, November 13, 2009 12:59 PM GridView, Datagrid, DataList & Repeater | Back to top


Comments on this post: Get a Weak or Strong DataTable Row from a selected DataGridView row.

# cheap pumas
Requesting Gravatar...
Thanks! Puma shoes online store provide us cheap puma shoes and puma women shoes .Prepared to give you a pleasant shopping trip. Enjoy shopping, enjoy cool shoes and low price from www.pumaforever.com
Left by puma speed cat on Nov 18, 2009 11:31 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Left by puma sneaker on Feb 02, 2010 12:41 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I think I am not good enough for this soft. I can not understand it.wedding dresses
cheap wedding dresses
Left by ff on Mar 29, 2010 12:18 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Very good work! I always like to leave comments whenever I see something unusual or impressive. I think we must appreciate those who do something especial. Keep it up, thank
Left by online books on Jul 22, 2010 12:35 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Very good work! I always like to leave comments whenever I see something unusual or impressive.
Left by geo tv live on Jul 22, 2010 12:36 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Very good work! I always like to leave comments whenever I see something unusual or impressive. and may be you like nfl jerseys
Left by reebok jerseys on Aug 06, 2010 3:35 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Money can`t buy Happiness?Hermes BirkinWhoever said that doesn`t know where to buy.
Buyhermesbirkin offers the high quality Hermes bags and services.
No matter it is the classic Birkin bag,Hermes Handbagor the Kelly and Lindy bag,
or the latest new designs,you can find them here.Just selecting oneyou will be the next Victoria in the street Comes from Shuna Sun
Left by Hermes Birkin on Aug 13, 2010 1:45 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
The information that posted is very useful, I am expecting for your next post.Again&nbsp;nike dunk&nbsp;thank you for your sharing.
Left by nike dunk on Sep 02, 2010 8:35 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Too many bright minds in different directions come together,resulting a huge energy.New ways with new markets with new ideas.
Left by Replica Designer Handbags on Oct 25, 2010 5:00 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I was looking for this the other day. i dont usually post in forums but i wanted to say thank you!
Left by Air Max on Nov 03, 2010 12:44 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
[url=http://www.uslouisvuitton.com/]louis vuitton[/url]
Left by burberry on Nov 09, 2010 3:02 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
nice to read this blog as it helped me alot free sql books
Left by free computer books on Nov 22, 2010 12:51 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Well,i like your article,i will share it to my friend.
Left by camcorders on Dec 01, 2010 1:11 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Time can change most of things.
Left by electronics on Dec 17, 2010 3:17 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here! keep up the good work
Left by retro jordan sneakers on Dec 18, 2010 1:15 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
nice keep it up i really appriate you
Left by sending flowers italy on Mar 12, 2011 3:01 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
You are best i really like your post keep it up
Left by flower shop philippines on Mar 12, 2011 3:03 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
,i will share it to my friend.
Left by tory burch on Mar 16, 2011 11:42 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
thanks for thIS wonderful artile post
Left by free cooking books on Mar 21, 2011 9:43 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Good post....thanks for sharing.. very useful for me i will bookmark this for my future needs. Thanks.
Left by evitamins on Mar 28, 2011 11:58 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
housses en cuir très haut de gamme pour préserver vos téléphones portables et appareils mobiles avec style. D'une qualité exceptionnelle, les étuis en cuir,housse samsung galaxy s et protections mobiles font l'objet d'un suivi régulier lors de leurs fabrications et respectent un ensemble de critères qualité très strictes. housse samsung galaxy s 2 Découvrez un catalogue varié de et dédié à la préservation de vos smartphones et composé d'étuis verticaux et de , de housses à clapet, de fourreaux de protection horizontaux et de pochettes en cuir ouvrantes. Les housses de protection en cuir sont disponibles pour les modèles de smartphone iPhone 4, iPhone 3GS, iPad, Blackberry Torch, Curve, Bold, Nokia N8, Xperia X10, Samsung Galaxy S, Samsung Wave et HTC Desire. L'objectif de la est de proposer aux possesseurs de téléphones dits "intelligents" des moyens de protection efficaces, robustes, durables et d'une qualité inégalée. Les étuis en cuir pour mobiles sont également très pratiques et simples d'utilisation. Les écrins proposés comme les assurent un confort de manipulation optimal et se révèlent indispensables au quotidien.
Left by rsanchez on Apr 20, 2011 7:03 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I’ve seen progression in every post. Your newer posts are simply wonderful compared to your posts in the past. Keep up the good work.

Orvis.com
Left by Orvis.com on May 09, 2011 7:06 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Your tutorial here about how to get a weak or strong datatable row from a selected datagridview row is very useful for me and I just wanted to add that your explanation here is very simple to understand. I will try it out soon enough. Thank you very much.
Left by dll file extension on May 14, 2011 11:07 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Fantastic read, many thanks for sharing.
Left by contemporary canvas on May 26, 2011 6:15 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
Very nice information here. Going to bookmark it!
Left by vetionx pet health on Jun 03, 2011 4:28 PM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...

Meditrustrx is best Cupid Pharmacy" North America 2011. provides female sildenafil
Left by KEVIN on Jun 27, 2011 7:34 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I wonder if you could develop an online printing company data table that could extract the last command issued by the computer to the printer and then redirect that to another printer that is free to accept a print job.
Left by JamesBond on Jun 27, 2011 10:20 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
These are really very useful information ,thanks for sharing!
Left by songfang on Aug 26, 2011 4:43 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I’ve seen progression in every post. Your newer posts are simply wonderful compared to your posts in the past. Keep up the good work.
Left by Lithium-ion Battery on Nov 15, 2011 6:26 AM

# re: Get a Weak or Strong DataTable Row from a selected DataGridView row.
Requesting Gravatar...
I am absolutely amazed at how terrific the stuff is on this site. I have saved this webpage and I truly intend on visiting the site in the upcoming days. Keep up the excellent work!
Left by Christmas Flowers canada on Dec 07, 2011 11:51 PM

# super shoes
Requesting Gravatar...
Historically, sports shoes producers pay most of the attention to the property of the shoes. The first point of every pair of shoes is the comfort feeling. If it can improve the performance of the players. The brand will become world known, Adidas shoes is such a brand. With the development of society, designers begin to do something different to the shape and look of running shoes. Drawing people’s attention become quite important. When fashion becomes part of the life, sports shoes begin to connect with fashion closely. Without fashion element, shoes will not be shoes.
Left by paul on Dec 16, 2011 12:31 AM

Your comment:
 (will show your gravatar)


Copyright © Rodney Vinyard | Powered by: GeeksWithBlogs.net