473,394 Members | 1,865 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,394 software developers and data experts.

DataGridView Questions

I have a couple questions regarding the DataGridView object...

1) What is the underlying data type that the DataGridView uses if you
are using it unbound and do for instance dgv.Columns.Add(). Is there
any way to access that data type directly, since the DataSource field
is null when the DataGridView is unbound?

2) Is there any way to add a row which does not have as many columns
as the rest of the grid? Basically I have about 10 columns of data
but every so often I want to put an "event" row in the table to show
where an event happened. I pretty much just want that event row to
have 2 columns, one to say the time the event happened and another
with the description of the event. Is this possible in the
DataGridView object, or if not then is it possible in any other native
C# object that I can display in a DataGridView type fashion?

Thanks in advance,
Stu
Nov 19 '08 #1
1 2337
st*******@gmail.com schrieb:
1) What is the underlying data type that the DataGridView uses if you
are using it unbound and do for instance dgv.Columns.Add(). Is there
any way to access that data type directly, since the DataSource field
is null when the DataGridView is unbound?
I am nearly ONLY using unbound grids, but that question never came to my
mind. I usually find that if I _presume_ the underlying datatype to be
of type "string" as long as it is undefined, then I don't have problems.
but every so often I want to put an "event" row in the table to show
where an event happened. I pretty much just want that event row to
have 2 columns, one to say the time the event happened and another
with the description of the event.
Maybe a "ListView" control can even do better what you want. If you want
to stick to the DataGridView you can use the CellPaint-Events to
determine which type of row is displayed.
I never touched the borders of cells for such a purpose, but it should
be possible to make the cell-borders of neighbouring cells disappear in
the beforecellpaint event, for each row that is of type "event".
Nov 20 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brian | last post by:
I've got a couple questions on the new Datagridview control in VS2005. 1) In the old datagrid control at design time I was able to add multiple tablestyles with columns from different...
2
by: mark carew | last post by:
Hi All DataGridView Users. I have noticed that there seems to be very little useful response to DataGridView questions in this news group. I have looked at the spanish, belgium, french, italian...
1
by: George | last post by:
Hi, I have a DataGridView, bounded to a DataTable which is populated/updated by a OleDbDataAdapter (with OleDbConnection) to an Access Database. (Sounds familiar to some of you ... I have...
6
by: George | last post by:
Hi, I have been encountering a refresh problem with DataGridView, which is bound to a DataTable. When I make updates (Add, Delete, update) to the DataGridView, everything flow nicely to...
3
by: =?Utf-8?B?UGV0ZXI=?= | last post by:
I'm trying to add a datagridview control to a Windows Form to display read-only information in visual basic 2005. My understanding is that datareader will be faster for this purpose. I have the...
0
by: Alcibiade | last post by:
Hi, I have 2 questions: 1)if width datagridview is shorter than form witdh, user will see horizontal scrollbar to see all grid.How can I adapt width form to width datagridview? 2) If a cell...
7
by: cj | last post by:
As your probably aware the datagridview doesn't update it's source datatable with changes to a cell until you move off that cell. Suppose somone makes a change in a cell of my datagridview then...
11
by: dave18 | last post by:
Hello all! I found a solution to my original question, but there's still so much I don't understand about it, I thought I'd give this forum a try. At the very least, maybe it will help someone...
2
by: Stewart Berman | last post by:
I have an application that populates a DataGridView control with an XML. file. 1. How do I set up the process so the user initally sees just the headers -- no records. I have the DataGridView...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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.