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

Add columns in Datagrid

Hi
I want to add columns in a Datagrid and I want the Columnheaders to show and
empty cells to show without adding any records. For example, sometimes there
aren 't any records in the database, which the datagrid is based on or you
haven't added anything to the columns. How do I do that and how do I add
things to the columns if the Datagrid is not bound to a database or want to
add things not from a database.

Hope you understand what I mean with my questions, have a hard time myself.

Happy for answers

Fia

Jul 1 '06 #1
1 1548
Fia,

A datagrid, assuming is windows forms is never binded to a database. It is
almost forever binded direct or indirect to a datatable. You can add as much
columns to that as you wish. Be aware that added columns will not be
updated.

I think that in this sample is all you need.

http://www.vb-tips.com/dbPages.aspx?...3-a3539697edbd

I hope this helps,

Cor

"Familjen Karlsson" <fi*****@telia.com> schreef in bericht
news:WU*****************@newsb.telia.net...
Hi
I want to add columns in a Datagrid and I want the Columnheaders to show
and
empty cells to show without adding any records. For example, sometimes
there
aren 't any records in the database, which the datagrid is based on or you
haven't added anything to the columns. How do I do that and how do I add
things to the columns if the Datagrid is not bound to a database or want
to
add things not from a database.

Hope you understand what I mean with my questions, have a hard time
myself.

Happy for answers

Fia

Jul 1 '06 #2

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

Similar topics

7
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
2
by: Kevin | last post by:
Hi Al Can someone tell me how to hide colums in a datagrid. I have a one datagrid that is a master and child and I would like to hide specific columns, how do I do this TI Kevin
1
by: Amber | last post by:
The DataGrid allows you to make columns visible or invisible on demand - even edit and other special columns. This article will show you how it is done. Some developers have reported problems...
1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
6
by: John Ruiz | last post by:
Greetings, I originally posted this to microsoft.public.dotnet.framework.aspnet.datagridcontrol two weeks ago, but no one was able to answer. I am unable to dynamically add columns to a...
3
by: Allen K | last post by:
Hi, I'm programmatically creating a HyperLink column for my datagrd ( in addition to Bound Columns created through the VS.NET Visual Interface ). However, when a Postback occurs, this column...
8
by: Hanson | last post by:
I have a datagrid control in an aspx page. The datagrid columns will be dynamically generated according to the pre-page's search condition, I want to hide some columns in the datagrid. is that...
2
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
0
by: tafpin | last post by:
I have an application with a datagrid. In the IDE I have 2 template columns. The first has an image button and the second contains a link button. According to the results that I get back I must...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.