473,671 Members | 2,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

36 New Member
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 2191
kattiegriri
1 New Member
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
6818
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 are dynamic which means that I am right now creating the schema/structure of the datatable from a datareader using reader.GetSchemaTable() and then looping thru the reader to populate values. Is there any other efficient way of achieving this?...
0
1035
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 repackage all this to a datatable. Is there a better way of doing this?
1
8704
by: cpnet | last post by:
I have a DataTable defined in a strongly-typed DataSet: public class MyDataSet: DataSet... { ... public class MyDataTable: DataTable... { ...}
5
51632
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 DataColumn( "StartDate", typeof( DateTime? ) ) ); dtSearchFromData.Columns.Add( new DataColumn( "EndDate", typeof( System.Nullable<DateTime>) ) ); Any ideas?
3
94244
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 database. For example: table JobTypes 1 | Manager 2 | Controller 3 | Supervisor table Employee
0
883
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 ADO.Net refuses to generate update support. It's smart enough to tolerate calculated columns when they're included, so what's the matter with this case - can't it just ignore that column as well? Is that a limitation of the code generator? Any...
0
1054
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 application do: menuDataTable.ReadXml(filename);
2
2719
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 isn't possible can anyone tell me how to do batched updates on a strongly typed datatable? Thanks
1
3559
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 myTable"; using (SqlConnection conn = new SqlConnection(websqlconn)) { SqlCommand cmd = new SqlCommand(sql, conn);
0
779
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 a general solution for my display layer that is much shorter than coding the "data --> display" part of the windows form every time I need to display a DataGridView, ComboBox, etc.
0
8483
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8402
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8825
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8605
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8676
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7445
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4416
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.