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 / WinForm Controls / October 2005

Tip: Looking for answers? Try searching our database.

How do I set column widths in a datagrid?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Arne - 24 Oct 2005 13:22 GMT
My table styles blows up
Dim dgts As DataGridTableStyle = New DataGridTableStyle
dgts.MappingName = "composition"
CatCompositionGrid.TableStyles.Add(dgts)
dgts.GridColumnStyles(0).Width = 75
dgts.GridColumnStyles(1).Width = 25
dgts.GridColumnStyles(2).Width = 25
dgts.GridColumnStyles(3).Width = 75
dgts.DataGrid.Refresh()

What am I doing wrong?
Sanjeevakumar Hiremath - 28 Oct 2005 14:55 GMT
dgts.MappingName = "composition" -- this should be same as TableName
Is the table name you are showing same as the MappingName?
that can be one problem.

Secondly.. DataGridColumnStyle mapping names should be matching to each of
the column names in the table.

Hope this helps,

Signature

Regards,
Sanjeevakumar Hiremath
Proteans Software Solutions
http://sharpnet.blogspot.com

> My table styles blows up
> Dim dgts As DataGridTableStyle = New DataGridTableStyle
[quoted text clipped - 7 lines]
>
> What am I doing wrong?
Arne - 28 Oct 2005 15:33 GMT
Yes,
When I tried to set the style before I set the data source it blows up.

> dgts.MappingName = "composition" -- this should be same as TableName
> Is the table name you are showing same as the MappingName?
[quoted text clipped - 16 lines]
> >
> > What am I doing wrong?

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.