Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Binding custom data object to checkbox list?

Reply
Thread Tools

Binding custom data object to checkbox list?

 
 
cannontrodder
Guest
Posts: n/a
 
      08-15-2006
I am displaying names and other details of my users in a Formview
control by binding my custom business object to it. My custom object
also has a property that is a collection of boolean values and I would
like to show a checkboxlist within my formview to represent them.

I just have no idea how to bind this collection to a list within the
formview? Has anyone got any ideas on this? I don't need the full code,
just a pointer in the right direction!

 
Reply With Quote
 
 
 
 
Islamegy®
Guest
Posts: n/a
 
      08-15-2006
first why do u bind checkboxlist to collection of boolean?! those values
will be the text or the value??
it's meaningless as i see.

anyway if the custom object has a property has a collection of boolean then
bind checkboxlist to this property but this property getter do the work of
getting these values(ex. master-details you must call fill method of the
child)..

objectDataSource won't be able to invoke fill method of the values..




"cannontrodder" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
>I am displaying names and other details of my users in a Formview
> control by binding my custom business object to it. My custom object
> also has a property that is a collection of boolean values and I would
> like to show a checkboxlist within my formview to represent them.
>
> I just have no idea how to bind this collection to a list within the
> formview? Has anyone got any ideas on this? I don't need the full code,
> just a pointer in the right direction!
>



 
Reply With Quote
 
 
 
 
cannontrodder
Guest
Posts: n/a
 
      08-15-2006
Well the collection indicates which roles a user is in. EG:
roles("admin")=False

That seems a logical way to store it internally??

I'm having trouble following what you are saying here. This is my
declaritive code:

<asp:Label runat="server" Text='<%# Eval("Username") %>' />
<asp:Label ID="Label5" runat="server" Text='<%# Eval("Email") %>' />
<asp:Label ID="Label6" runat="server" Text='<%# Eval("Firstname") %>'
/>
<asp:Label ID="Label7" runat="server" Text='<%# Eval("Lastname") %>' />

<asp:CheckBoxList ID="CheckBoxList1" runat="server" />

Username, Email, Firstname, Lastname and UserRoles are all members of
the data object that the formview is bound to. I just can't see how I
would declaratively bind that collection in the CheckBoxList tag above?


Islamegy® wrote:
> first why do u bind checkboxlist to collection of boolean?! those values
> will be the text or the value??
> it's meaningless as i see.
>
> anyway if the custom object has a property has a collection of boolean then
> bind checkboxlist to this property but this property getter do the work of
> getting these values(ex. master-details you must call fill method of the
> child)..
>
> objectDataSource won't be able to invoke fill method of the values..
>
>
>
>
> "cannontrodder" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) ups.com...
> >I am displaying names and other details of my users in a Formview
> > control by binding my custom business object to it. My custom object
> > also has a property that is a collection of boolean values and I would
> > like to show a checkboxlist within my formview to represent them.
> >
> > I just have no idea how to bind this collection to a list within the
> > formview? Has anyone got any ideas on this? I don't need the full code,
> > just a pointer in the right direction!
> >


 
Reply With Quote
 
cannontrodder
Guest
Posts: n/a
 
      08-15-2006
Ah, looks like I need to use the colelction syntax:

http://support.microsoft.com/?id=307860


cannontrodder wrote:
> Well the collection indicates which roles a user is in. EG:
> roles("admin")=False
>
> That seems a logical way to store it internally??
>
> I'm having trouble following what you are saying here. This is my
> declaritive code:
>
> <asp:Label runat="server" Text='<%# Eval("Username") %>' />
> <asp:Label ID="Label5" runat="server" Text='<%# Eval("Email") %>' />
> <asp:Label ID="Label6" runat="server" Text='<%# Eval("Firstname") %>'
> />
> <asp:Label ID="Label7" runat="server" Text='<%# Eval("Lastname") %>' />
>
> <asp:CheckBoxList ID="CheckBoxList1" runat="server" />
>
> Username, Email, Firstname, Lastname and UserRoles are all members of
> the data object that the formview is bound to. I just can't see how I
> would declaratively bind that collection in the CheckBoxList tag above?
>
>
> Islamegy® wrote:
> > first why do u bind checkboxlist to collection of boolean?! those values
> > will be the text or the value??
> > it's meaningless as i see.
> >
> > anyway if the custom object has a property has a collection of boolean then
> > bind checkboxlist to this property but this property getter do the work of
> > getting these values(ex. master-details you must call fill method of the
> > child)..
> >
> > objectDataSource won't be able to invoke fill method of the values..
> >
> >
> >
> >
> > "cannontrodder" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed) ups.com...
> > >I am displaying names and other details of my users in a Formview
> > > control by binding my custom business object to it. My custom object
> > > also has a property that is a collection of boolean values and I would
> > > like to show a checkboxlist within my formview to represent them.
> > >
> > > I just have no idea how to bind this collection to a list within the
> > > formview? Has anyone got any ideas on this? I don't need the full code,
> > > just a pointer in the right direction!
> > >


 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Binding data to Grid control with CUSTOM DATA CLASS vineetbatta ASP .Net Datagrid Control 0 10-16-2006 06:56 AM
Binding data to object and its nested object (ASP.NET 2.0) Piotrek ASP .Net 4 08-04-2006 10:09 AM
Custom control within repeater with custom object binding - .net 1 =?Utf-8?B?SmF5YnVmZmV0?= ASP .Net 9 02-21-2006 03:38 AM
Complex data binding question, binding child objects of a custom collection. JcFx ASP .Net Datagrid Control 0 06-01-2005 04:01 PM
How do I do data binding with a checkbox? Alan Silver ASP .Net 1 02-22-2005 08:52 PM



Advertisments