PC Review


Reply
Thread Tools Rate Thread

DataTable used as DataSource in DataGridView

 
 
Anders Eriksson
Guest
Posts: n/a
 
      20th Aug 2011
I have a DataTable that I use as a DataSource for a DataGridView. Now I
need to add a Column to the DataTable, but I don't want it to be shown
in the DataGridView!

Is this possible and if so how do I do it?

// Anders
 
Reply With Quote
 
 
 
 
Jason Keats
Guest
Posts: n/a
 
      20th Aug 2011
Anders Eriksson wrote:
> I have a DataTable that I use as a DataSource for a DataGridView. Now I
> need to add a Column to the DataTable, but I don't want it to be shown
> in the DataGridView!
>
> Is this possible and if so how do I do it?


this.dataGridView1.Columns["myColumnName"].Visible = false;
 
Reply With Quote
 
Anders Eriksson
Guest
Posts: n/a
 
      20th Aug 2011
On 2011-08-20 16:32, Jason Keats wrote:
> this.dataGridView1.Columns["myColumnName"].Visible = false;


Doh!

I was looking for something in the DataTable.

Thank you very much!

// Anders
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DataGridView.DataSource = DataSet / DataTable puzzle John Rivers Microsoft Dot NET Framework Forms 0 14th May 2010 12:38 PM
DataGridView and Xml as DataSource black_sun@email.it Microsoft VB .NET 1 26th Dec 2008 09:19 PM
A DataTable-bound DataGridView throws a low-level Exception whencolumns are sorted, removed and re-added to the underlying DataTable. Sath123 Microsoft Dot NET Framework Forms 1 12th May 2008 12:51 PM
DataGridView and Datasource Gabriel Microsoft Dot NET Framework Forms 1 5th Feb 2007 08:14 PM
DataGridView, DataSource, Columns and Datatable. =?Utf-8?B?R2Vvcmdl?= Microsoft C# .NET 8 26th May 2006 02:50 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:21 PM.