Solved

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

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

706 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

19 Experts available now in Live!

Get 1:1 Help Now