Solved

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

Posted on 2008-10-30
2
2,403 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

17 Experts available now in Live!

Get 1:1 Help Now