473,388 Members | 1,215 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

How to bind DataGridView to single column in strongly typed DataTable?

36
I would like to implement Virtual mode on a DataGridView. The issue is that I'm not sure how to bind to ONLY the ID column in my DataTable without binding to the whole table.

Adding combobox or textbox columns and handling the CellValueNeeded event is not a problem, I've done that elsewhere in my program.

I would like to use something like
Expand|Select|Wrap|Line Numbers
  1. DataGridView.DataSource = MyDataset.Tables("TableName").Columns("ID")
, but no data is displayed.

Is there a way to bind to a single column of data, instead of binding to the whole table and hiding all the (non-custom) columns?
Nov 13 '10 #1
1 2178
In it Columns are using a user-defined type (I Node) not one of the base .NET Framework data types and Byte[]. I Node have to be marked by the Serializable Attribute at least.For more information visit it dapfor com/en/net-suite/net-grid/tutorial/data-types
Aug 16 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Somebody_Out_There | last post by:
Hello, I am trying to create a strongly typed datatable/dataset from an untyped dataset or datatable returned from a stored proc. The structure of the table cannot be static since the results...
0
by: Jensen bredal | last post by:
hello, I need to do the described operation, I thought this should be possible with a DataTable.Select but, it returns an array of rows, and this is not good for performance as i have to...
1
by: cpnet | last post by:
I have a DataTable defined in a strongly-typed DataSet: public class MyDataSet: DataSet... { ... public class MyDataTable: DataTable... { ...}
5
by: GG | last post by:
I am trying to add a nullable datetime column to a datatable fails. I am getting exception DataSet does not support System.Nullable<>. None of these works dtSearchFromData.Columns.Add( new...
3
by: sklett | last post by:
I'm changing from a DataGrid to a DataGridView and have run across a problem. The items that are bound to the DataGrid have an int Property that represents a primary key of a lookup table in my...
0
by: PJ6 | last post by:
I want to bind a grid to a strongly-typed dataset that needs to display a single non-updatable column; basically I have a join on a join. I need to have the rest of the information updatable, but...
0
by: timnels | last post by:
I have a strongly-typed DataTable I need to save as XML and later reload it. I thought that all I had to do was: menuDataTable.WriteXml(filename,XmlWriteMode.WriteSchema); And from another...
2
by: Simon | last post by:
Hi all, Is it somehow possible to do do batched updates with table adapters in the same way you can with data adapters? I expected the methods to be much the same but apparently not. If it...
1
by: Code Monkey | last post by:
Silly question maybe, but I've been doing the following for far too long now: public static DataTable myDataTable() { string sql = @"SELECT column1, column2, column3, column4 FROM...
0
by: Infog | last post by:
Is it possible to edit a strongly typed dataset so that each table and column has additional properties? If I could record the ValueMember and DisplayMember for each table I'm using, I could write...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.