Solved

VB 2008  - Assign a value to a non-visible Datagrid field

Posted on 2009-07-06
2
164 Views
Last Modified: 2012-05-07
My DataGridView1 has 6 column fields.  One column, uProject, has Visible set to False.  

How do I assign a value to that field.  The value is not dependent on any other field.  It is a program generated unique sequential number.  Something like: uProject = LastProject + 1.

All of the other column fields for the Row are entered by the user.

0
Comment
Question by:ljcor
2 Comments
 
LVL 4

Accepted Solution

by:
rdoran0928 earned 500 total points
ID: 24785023
I assume that you are talking about entering data for a new record.  If so, you can set the value of any column, whether visible or not as follows in DataGridView1's RowLeave event handler by doing:

DataGridView1.Item(columnIndex, DataGridView1.CurrentRow.Index).Value = uProject

or

DataGridView1.Item("columnName", DataGridView1.CurrentRow.Index).Value = uProject
0
 

Author Closing Comment

by:ljcor
ID: 31600125
OK, I'll go with that.  And thanks for the solution.
jack
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now