Solved

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

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

734 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