Hi,

I have created a class with some properties
Class Manager
Private msName a s string
Private msSurnaname as string
Private mdSalary as double
Public Property Name() as string
.....Implementation
....Similarly implemented all the properties
...Some functions
End Class

To make class bindable I created a custom collection class
Class Managers
Inherits CollectionBase

Public Function AddManager() as Manager
'implementation code....
End Function

Public ReadOnly Property Item(byval index as integer) as Manager
'implementation code....
End Property
End Class

When I create instance of Managers class and added some manager objects to
it. I tried to bind this to a third party grid (Data grid wont bind). It
worked..But my problem is how I can control order of properties in columns.

I see Columns in Surname, Name, Salary order...What should I do to ensure
that my columns come in Name, Surname abd Salary order?

I wonder How dataset achieve this? In dataset you'll always se fields in
same order as they appear in XSD schema..Is there any way to achive this
functionality?

Thanks,
Abhishek
jain_abhishek_77@yahoo.co.in

RE: How to control order of properties in a class by NoSpamMgbworld

NoSpamMgbworld
Fri Sep 02 08:56:07 CDT 2005

In a strongly typed Dataset, the order in the XML document is the order you
see the properties in.

From your question I assume you are trying to figure out how to bind to a
collection of objects and have the Grid look like:

Name Surname Salary
John Doe $100,000

etc.

If so, it is best that you control the binding. In ASP.NET, you add
BoundColumns to do this and turn off the auto gen'ed columns.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"Abhishek" wrote:

> Hi,
>
> I have created a class with some properties
> Class Manager
> Private msName a s string
> Private msSurnaname as string
> Private mdSalary as double
> Public Property Name() as string
> .....Implementation
> ....Similarly implemented all the properties
> ...Some functions
> End Class
>
> To make class bindable I created a custom collection class
> Class Managers
> Inherits CollectionBase
>
> Public Function AddManager() as Manager
> 'implementation code....
> End Function
>
> Public ReadOnly Property Item(byval index as integer) as Manager
> 'implementation code....
> End Property
> End Class
>
> When I create instance of Managers class and added some manager objects to
> it. I tried to bind this to a third party grid (Data grid wont bind). It
> worked..But my problem is how I can control order of properties in columns.
>
> I see Columns in Surname, Name, Salary order...What should I do to ensure
> that my columns come in Name, Surname abd Salary order?
>
> I wonder How dataset achieve this? In dataset you'll always se fields in
> same order as they appear in XSD schema..Is there any way to achive this
> functionality?
>
> Thanks,
> Abhishek
> jain_abhishek_77@yahoo.co.in

RE: How to control order of properties in a class by Abhishek

Abhishek
Sat Sep 03 01:04:01 CDT 2005

Thanks,

I am mapping columns in a third party grid to over come this problem.
However, I was wondering how a dataset achives this?

regards,
Abhishek

"Cowboy (Gregory A. Beamer) - MVP" wrote:

> In a strongly typed Dataset, the order in the XML document is the order you
> see the properties in.
>
> From your question I assume you are trying to figure out how to bind to a
> collection of objects and have the Grid look like:
>
> Name Surname Salary
> John Doe $100,000
>
> etc.
>
> If so, it is best that you control the binding. In ASP.NET, you add
> BoundColumns to do this and turn off the auto gen'ed columns.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "Abhishek" wrote:
>
> > Hi,
> >
> > I have created a class with some properties
> > Class Manager
> > Private msName a s string
> > Private msSurnaname as string
> > Private mdSalary as double
> > Public Property Name() as string
> > .....Implementation
> > ....Similarly implemented all the properties
> > ...Some functions
> > End Class
> >
> > To make class bindable I created a custom collection class
> > Class Managers
> > Inherits CollectionBase
> >
> > Public Function AddManager() as Manager
> > 'implementation code....
> > End Function
> >
> > Public ReadOnly Property Item(byval index as integer) as Manager
> > 'implementation code....
> > End Property
> > End Class
> >
> > When I create instance of Managers class and added some manager objects to
> > it. I tried to bind this to a third party grid (Data grid wont bind). It
> > worked..But my problem is how I can control order of properties in columns.
> >
> > I see Columns in Surname, Name, Salary order...What should I do to ensure
> > that my columns come in Name, Surname abd Salary order?
> >
> > I wonder How dataset achieve this? In dataset you'll always se fields in
> > same order as they appear in XSD schema..Is there any way to achive this
> > functionality?
> >
> > Thanks,
> > Abhishek
> > jain_abhishek_77@yahoo.co.in