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

Datagrid question about columns

Hi everybody,

I have a question about the datagrid.

I have a datagrid and I have set the datasource property to equal a dataset.

the datagrid fills up with the columns (prodno, description, price , siteID
, userID)

how do I hide the columns price and userID so that my grid only displays ?

(prodNo, description, userID)

Please advise,

Many thanks,
Nov 21 '05 #1
3 1002
Hi,

Add a tablestyle to your datagrid.

http://msdn.microsoft.com/library/de...asicprimer.asp

http://msdn.microsoft.com/library/de...stdatagrid.asp

Ken
------------------
"Bob Taylor" <Bob Ta****@discussions.microsoft.com> wrote in message
news:05**********************************@microsof t.com...
Hi everybody,

I have a question about the datagrid.

I have a datagrid and I have set the datasource property to equal a dataset.

the datagrid fills up with the columns (prodno, description, price , siteID
, userID)

how do I hide the columns price and userID so that my grid only displays ?

(prodNo, description, userID)

Please advise,

Many thanks,
Nov 21 '05 #2
Bob,

That is very easy, use the datagridcolumnstyle

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps?

Cor

"Bob Taylor" <Bob Ta****@discussions.microsoft.com>
Hi everybody,

I have a question about the datagrid.

I have a datagrid and I have set the datasource property to equal a
dataset.

the datagrid fills up with the columns (prodno, description, price ,
siteID
, userID)

how do I hide the columns price and userID so that my grid only displays ?

(prodNo, description, userID)

Please advise,

Many thanks,

Nov 21 '05 #3
Here is the Solution,

Create a Tablestyle.

Create Column Styles, only for the columns u want to show.

add the column Styles to the TableStyle.

Add the TableStyle To the DataGridColumnStyles collection

"Bob Taylor" wrote:
Hi everybody,

I have a question about the datagrid.

I have a datagrid and I have set the datasource property to equal a dataset.

the datagrid fills up with the columns (prodno, description, price , siteID
, userID)

how do I hide the columns price and userID so that my grid only displays ?

(prodNo, description, userID)

Please advise,

Many thanks,

Nov 21 '05 #4

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

Similar topics

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: Ken Tucker | last post by:
I've read about this issue in many articles across the net... But haven't found a solution. I see all kinds of custom code to perform sorting with datagrids, but my example is so simple, I must...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
4
by: tshad | last post by:
I am having trouble with links in my DataGrid. I have Links all over my page set to smaller and they are consistant all over the page in both Mozilla and IE, except for the DataGrid. Here is a...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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?
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...

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.