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

About GridTableStylesCollection problem

Dear All :

I have a problem about define property GridTableStylesCollection in
usercontrol.

The code show as follow :
Public Property StylesCollector() As GridTableStylesCollection
Set(ByVal Value As GridTableStylesCollection)
_GridStyleCollection= Value
End Set

Get

StylesCollector = _GridStyleCollection
End Get
End Property
where _GridStyleCollection is a friend type of GridTableStylesCollection
however, when I use windows form to out this control onto the form the
property of control StylesCollector show empty also the member in property
windows always show empty even I have add object in it.
The problem shown as attachment

any idea to fix this problem ?

Thanks



Nov 21 '05 #1
2 1741
Hi,

Usually the get comes before the set in the property. You also we
returning the stylecollection wrong. Here is a real simple user control
with a stylecollection.

Public Class Class1
Inherits UserControl

Private _GridStyleCollection As GridColumnStylesCollection
Public Property StylesCollector() As GridColumnStylesCollection
Get
Return _GridStyleCollection
End Get
Set(ByVal Value As GridColumnStylesCollection)
_GridStyleCollection = Value
End Set
End Property

End Class

Ken
--------------------
"Michael" <la********@gmail.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
Dear All :

I have a problem about define property GridTableStylesCollection in
usercontrol.

The code show as follow :
Public Property StylesCollector() As GridTableStylesCollection
Set(ByVal Value As GridTableStylesCollection)
_GridStyleCollection= Value
End Set

Get

StylesCollector = _GridStyleCollection
End Get
End Property
where _GridStyleCollection is a friend type of GridTableStylesCollection
however, when I use windows form to out this control onto the form the
property of control StylesCollector show empty also the member in property
windows always show empty even I have add object in it.
The problem shown as attachment

any idea to fix this problem ?

Thanks


Nov 21 '05 #2
Thanks for your advice.

However, I have copy your script into test my project

The code is that :
Imports System.Windows.Forms
Public Class MilesBox
Inherits System.Windows.Forms.UserControl
Private _GridStyleCollection As GridTableStylesCollection
Public Property StylesCollector() As GridTableStylesCollection
Get
Return _GridStyleCollection
End Get
Set(ByVal Value As GridTableStylesCollection)
_GridStyleCollection = Value
End Set
End Property
end class

Then I create a new project and new vb form. I drag-drop the usercontrol
(milesbox) into the form. I click the milesbox and right click the property.
Find the StylesCollector
The value is still show nothing or empty (I know the normal case should show
"collection" on bold fonts). It show a small button caption as "..." I
click this button and try to add value in this collection. After edit and
click ok. The collection properties windows then close. But The value is
still show nothing or empty.
Anythings I miss to do ?
Thanks for your experts help
Michael Yip
VB.Net Beginner Developer.
"Ken Tucker [MVP]" <vb***@bellsouth.net> ¼¶¼g©ó¶l¥ó·s»D:ea**************@TK2MSFTNGP11.phx.g bl...
Hi,

Usually the get comes before the set in the property. You also we
returning the stylecollection wrong. Here is a real simple user control
with a stylecollection.

Public Class Class1
Inherits UserControl

Private _GridStyleCollection As GridColumnStylesCollection
Public Property StylesCollector() As GridColumnStylesCollection
Get
Return _GridStyleCollection
End Get
Set(ByVal Value As GridColumnStylesCollection)
_GridStyleCollection = Value
End Set
End Property

End Class

Ken
--------------------
"Michael" <la********@gmail.com> wrote in message
news:%2***************@TK2MSFTNGP14.phx.gbl...
Dear All :

I have a problem about define property GridTableStylesCollection in
usercontrol.

The code show as follow :
Public Property StylesCollector() As GridTableStylesCollection
Set(ByVal Value As GridTableStylesCollection)
_GridStyleCollection= Value
End Set

Get

StylesCollector = _GridStyleCollection
End Get
End Property
where _GridStyleCollection is a friend type of GridTableStylesCollection
however, when I use windows form to out this control onto the form the
property of control StylesCollector show empty also the member in
property
windows always show empty even I have add object in it.
The problem shown as attachment

any idea to fix this problem ?

Thanks



Nov 21 '05 #3

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

Similar topics

220
by: Brandon J. Van Every | last post by:
What's better about Ruby than Python? I'm sure there's something. What is it? This is not a troll. I'm language shopping and I want people's answers. I don't know beans about Ruby or have...
39
by: Marco Aschwanden | last post by:
Hi I don't have to talk about the beauty of Python and its clear and readable syntax... but there are a few things that striked me while learning Python. I have collected those thoughts. I am...
51
by: Noam Raphael | last post by:
Hello, I thought about a new Python feature. Please tell me what you think about it. Say you want to write a base class with some unimplemented methods, that subclasses must implement (or...
125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
3
by: Jack | last post by:
On the 1st of January 1998, Bjarne Stroustrup gave an interview to the IEEE's 'Computer' magazine. Naturally, the editors thought he would be giving a retrospective view of seven years of...
7
by: Edward Yang | last post by:
A few days ago I started a thread "I think C# is forcing us to write more (redundant) code" and got many replies (more than what I had expected). But after reading all the replies I think my...
0
by: Michael | last post by:
Thanks for your advice. However, I have copy your script into test my project The code is that : Imports System.Windows.Forms Public Class MilesBox Inherits System.Windows.Forms.UserControl...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.