Solved

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

Posted on 2009-07-06
2
169 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

635 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