Solved

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

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 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