Solved

How to add value to a datagridview column....

Posted on 2008-10-30
2
2,406 Views
Last Modified: 2013-12-17
hi

i have one grid with 2 datasets, the grid displays rows from 2 datasets, and i want my new column in my grid to add text to all rows added from dataset2.....

how can i only add a text to rows added from dataset2...? and not ALL rows displayed in the grid....?!
private void Reset()
        {
            
            gridImports.AutoGenerateColumns = false;
            DataSet myDsFilesToUndo = AmEngine.Instance.GetUnreconciledImpFiles(myOperator);
            DataSet importedReconsiledfiles = AmEngine.Instance.GetReconciledImpFiles(myOperator);
            
            int test = myDsFilesToUndo.Tables[0].Rows.Count;
            int test1 = importedReconsiledfiles.Tables[0].Rows.Count;
 
            myDsFilesToUndo.Merge(importedReconsiledfiles);
 
            gridImports.Columns[0].Name = "Reconsiled";
 
 
         
            
            gridImports.DataSource = myDsFilesToUndo.Tables[0];
 
}

Open in new window

0
Comment
Question by:Adnan
2 Comments
 
LVL 8

Accepted Solution

by:
jorgesv13 earned 500 total points
ID: 22840356
You can use the DataGridView DataBindingComplete event.
There you can loop through all the columns, and add the text only to the rows you want.
I'm assuming you can tell which row belonged to which dataset even after merging them.
0
 

Author Closing Comment

by:Adnan
ID: 31511583
thanks man
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

679 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