Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / August 2005

Tip: Looking for answers? Try searching our database.

Why no see Property Builder on grid

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Woody Splawn - 05 Aug 2005 16:10 GMT
It has been some time since I have used a regular datagrid on a winform
(have been using Infragistics grids instead).  However, today I tried
working with a datagrid but ran into a problem.  I need to make a couple of
the columns on the grid not visible.  That is, the grid is mapped to a
datasource.

The material I have says all I need to do is right click on the grid and
select Property Builder, but I see no Property Builder option when right
clicking on a grid.  What am I missing.

Using VS 2003.
robrich - 09 Aug 2005 18:40 GMT
Woody,

The Property Builder is part of the ASP.NET data grid, but not part of the
Windows Forms data grid.  (I expect confusion like this is why the VS 2005
grid is called "DataGridView" and the ASP.NET grid has another different
name.)

In Windows Forms world, a column is controlled by a ColumnStyle associated
with a TableStyle.  A TableStyle is bound to a particular table.  If you're
using the grid in "just do everything for me" mode, the TableStyle and
ColumnStyles are built for you.  If that's not the way you want it, ...

In the properties for the DataGrid, click on TableStyles and create a new
one.  Make the MemberName the name of the table you're displaying.  Then add
a ColumnStyle for each column you want to display.  Want to hide it?  don't
add it here.  You'll then have ultimate control of the grid.

The poor man's way to do it is to set the column width to 0 after the
InitializeComponent() method is called, but this leads to some odd problems.  
For example, if the user tab's through the grid, they'll land on these
"invisible" columns from time to time.

robrich

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.