PC Review


Reply
Thread Tools Rate Thread

Datagrid question about columns

 
 
=?Utf-8?B?Qm9iIFRheWxvcg==?=
Guest
Posts: n/a
 
      26th Nov 2004
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,
 
Reply With Quote
 
 
 
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      26th Nov 2004
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 (E-Mail Removed)> wrote in message
news:058DE09F-6A14-4190-967E-(E-Mail Removed)...
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,


 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      26th Nov 2004
Bob,

That is very easy, use the datagridcolumnstyle

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

I hope this helps?

Cor

"Bob Taylor" <Bob (E-Mail Removed)>

> 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,



 
Reply With Quote
 
=?Utf-8?B?UmFtYXJhanU=?=
Guest
Posts: n/a
 
      26th Nov 2004
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,

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question on datagrid columns Blasting Cap Microsoft ASP .NET 1 2nd Feb 2007 05:58 PM
Datagrid, binded columns and unbinded columns =?Utf-8?B?S2VycnkgTW9vcm1hbg==?= Microsoft VB .NET 4 28th Apr 2006 06:02 AM
How to add a Dropdown list to a datagrid at runtime (dynamic) without using template columns in ASP.NET and still have the ability to us the datagrid Update event. Daniel Roth Microsoft Dot NET Framework 0 5th Apr 2005 04:54 AM
Binding collection to a asp.net DataGrid - order of columns display question David Laub Microsoft ASP .NET 0 3rd Aug 2004 09:23 PM
DataGrid Component | Displaying columns of a DataSet as Rows in a DataGrid ? Diego TERCERO Microsoft C# .NET 3 19th Dec 2003 02:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:06 AM.