BP Forums
Datagrid Help - Printable Version

+- BP Forums (https://bpforums.info)
+-- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=55)
+--- Forum: Archived Forums (https://bpforums.info/forumdisplay.php?fid=56)
+---- Forum: VB.NET (Visual Basic 2010/2008) (https://bpforums.info/forumdisplay.php?fid=8)
+----- Forum: Programming Help (https://bpforums.info/forumdisplay.php?fid=9)
+----- Thread: Datagrid Help (/showthread.php?tid=599)



Datagrid Help - Moldraxian - 08-13-2012

Hello everybody! I just made a program that contains a datagridview. Is there a way to make information in a datagridview display in labels or textboxes?


Re: Datagrid Help - brandonio21 - 08-13-2012

Hmmm. Well, I think getting the data from a datagridview cell is pretty simple. All you need is the cell column and cell row. Then, you can get the value with this:
[code2=vbnet]Dim cIndex As Integer = 3 'Column Index
Dim rIndex As Integer = 5 'Row Index

Label1.Text =
Me.DataGridView1.Item(cIndex, rIndex).Value.ToString[/code2]

Hope this helps.


Re: Datagrid Help - Moldraxian - 08-14-2012

That looks like it would solve my problem. Would this method work with databases that contain over 700,000 entries? And Would it be able to work with null values?


Re: Datagrid Help - Moldraxian - 08-14-2012

Actually, nevermind. I found a super easy way to make it happen. When you source the database just go to textbox or label and in properties set the text to your sources database. Then keep working down until you find the feild you want <!-- sSmile --><img src="{SMILIES_PATH}/icon_e_smile.gif" alt="Smile" title="Smile" /><!-- sSmile -->


Re: Datagrid Help - brandonio21 - 08-14-2012

Oh yeah! I forgot that you could do that! Awesome. Well I'm glad you figured it out!