PC Review


Reply
 
 
Young
Guest
Posts: n/a
 
      26th May 2009
I got a table with 10 fields in it. I just want to display 3 fields on the
grid.

I've added a grid on the form and add 3 columns for the 3 fields.

I then created my datatable and bind it to the grid.

When I do this, the grid automaticall display all the 10 fields from my
table plus the 3 columns I've added in the grid.

Can someone please tell me how I can just display 3 fields from the table
(with 10 fields)?

In my datatable/dataset, I need all 10 fields but only display 3. The other
fields are used for something else.

TIA
Young


 
Reply With Quote
 
 
 
 
PvdG42
Guest
Posts: n/a
 
      26th May 2009

"Young" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I got a table with 10 fields in it. I just want to display 3 fields on the
>grid.
>
> I've added a grid on the form and add 3 columns for the 3 fields.
>
> I then created my datatable and bind it to the grid.
>
> When I do this, the grid automaticall display all the 10 fields from my
> table plus the 3 columns I've added in the grid.
>
> Can someone please tell me how I can just display 3 fields from the table
> (with 10 fields)?
>
> In my datatable/dataset, I need all 10 fields but only display 3. The
> other fields are used for something else.
>
> TIA
> Young
>

Have you tried removing the unwanted columns from the datagrid in the
properties?
If you need specific guidance, identify the version of VS, and the project
type (esp. Windows or web).

 
Reply With Quote
 
Jack Jackson
Guest
Posts: n/a
 
      26th May 2009
On Tue, 26 May 2009 19:04:57 +1000, "Young" <(E-Mail Removed)>
wrote:

>I got a table with 10 fields in it. I just want to display 3 fields on the
>grid.
>
>I've added a grid on the form and add 3 columns for the 3 fields.
>
>I then created my datatable and bind it to the grid.
>
>When I do this, the grid automaticall display all the 10 fields from my
>table plus the 3 columns I've added in the grid.
>
>Can someone please tell me how I can just display 3 fields from the table
>(with 10 fields)?
>
>In my datatable/dataset, I need all 10 fields but only display 3. The other
>fields are used for something else.
>
>TIA
>Young
>


Is this a DataGridView or really a DataGrid? DataGridView has a
property, on by default, that controls whether or not it should create
columns for all fields in the data source.
 
Reply With Quote
 
rohit.shrivastava04@gmail.com
Guest
Posts: n/a
 
      27th May 2009
On May 26, 2:04*pm, "Young" <young10...@hotmail.com> wrote:
> I got a table with 10 fields in it. I just want to display 3 fields on the
> grid.
>
> I've added a grid on the form and add 3 columns for the 3 fields.
>
> I then created my datatable and bind it to the grid.
>
> When I do this, the grid automaticall display all the 10 fields from my
> table plus the 3 columns I've added in the grid.
>
> Can someone please tell me how I can just display 3 fields from the table
> (with 10 fields)?
>
> In my datatable/dataset, I need all 10 fields but only display 3. The other
> fields are used for something else.
>
> TIA
> Young


You can set AutoGenerateColumn property to false.
 
Reply With Quote
 
Young
Guest
Posts: n/a
 
      1st Jun 2009
Thanks for all the help.

<(E-Mail Removed)> wrote in message
news:b3bafad4-4bf0-4977-af26-(E-Mail Removed)...
On May 26, 2:04 pm, "Young" <young10...@hotmail.com> wrote:
> I got a table with 10 fields in it. I just want to display 3 fields on the
> grid.
>
> I've added a grid on the form and add 3 columns for the 3 fields.
>
> I then created my datatable and bind it to the grid.
>
> When I do this, the grid automaticall display all the 10 fields from my
> table plus the 3 columns I've added in the grid.
>
> Can someone please tell me how I can just display 3 fields from the table
> (with 10 fields)?
>
> In my datatable/dataset, I need all 10 fields but only display 3. The
> other
> fields are used for something else.
>
> TIA
> Young


You can set AutoGenerateColumn property to false.


 
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
MVVM: Single datagrid row selection when a datagrid contains anotherdatagrid in side RowDetailsTemplate Sunita@.NET Microsoft C# .NET 0 12th Nov 2010 09:03 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
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
Added CheckBox to a DataGrid Doesn't work with DataGrid.Enabled=False Amar Microsoft ASP .NET 0 6th Apr 2004 11:14 AM
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 02:41 AM.