Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > CheckBoxList

Reply
Thread Tools

CheckBoxList

 
 
Terry Holland
Guest
Posts: n/a
 
      08-02-2005
I have a webform with a checkboxlist control on it. This control is used to
indicate which 'child' objects are related to a 'parent' object. I assign
by ticking and un-assign by unticking and then save the changes back to my
database. This is all working well but I now want to add some extra
functinality. Users need to be able to select an item in the checkboxlist
and move it up or down. Is this achievable using the checkbox list? ie can
I highlight the selected item in list and then move it up or down in the
list? I cant see any properties that would indicate that the selected item
can be highlighted or that I can indicate the position in the list that I
want to add the item.

tia

Terry Holland


 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      08-03-2005
Hi Terry,

Welcome to ASP.NET newsgroup.
REgarding on the CheckBoxList control's move item postion problem, here are
some of my understanding and suggestions:

1. For CheckedBoxList, it's can be populated either through manually adding
ListItems into its Items collection or using databinding to fill it. After
either approach, the binded items will be persisted in ViewState. And in
serverside code we can use its "Items" collection to find a certain item
and remove it or add new item.
So for your question, move items up/down, I think it's possible, since we
can remove a certain item first and use "insert" method to insert it to a
new position (through the index parameter ).

2. Based on the means I mentioned in #1, we can move up/down items in
checkedboxlist(of course, we need to carefully caculate the old/ new index
of the item we want to manipulate). Another problem here is that how can
we mark the item the use select to move, since the checkedboxList control
dosn't be designed to support this function, we may need to do some further
jobs to achieve it. For example, we can put a hidden field (<input
type="hidden" ...>) on the page and use some client side script to log the
item's index which user want to move.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)




--------------------
| From: "Terry Holland" <(E-Mail Removed)>
| Subject: CheckBoxList
| Date: Tue, 2 Aug 2005 12:14:26 +0100
| Lines: 16
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
| NNTP-Posting-Host: host202.multiserv.com 194.200.135.202
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontro ls:10226
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| I have a webform with a checkboxlist control on it. This control is used
to
| indicate which 'child' objects are related to a 'parent' object. I assign
| by ticking and un-assign by unticking and then save the changes back to my
| database. This is all working well but I now want to add some extra
| functinality. Users need to be able to select an item in the checkboxlist
| and move it up or down. Is this achievable using the checkbox list? ie
can
| I highlight the selected item in list and then move it up or down in the
| list? I cant see any properties that would indicate that the selected
item
| can be highlighted or that I can indicate the position in the list that I
| want to add the item.
|
| tia
|
| Terry Holland
|
|
|

 
Reply With Quote
 
 
 
 
Terry Holland
Guest
Posts: n/a
 
      08-03-2005
I have a couple of problems with the CheckBoxList control which is leading
me to look for a more appropraite control.
Problem 1) In some instances I need to display more than one column of
information
Problem 2) The user need to be able to select a row and the control needs to
indicate which row is selected (like a list box does)

With these problems in mind, is there a control that you would suggest? The
datagrid comes to mind but I dont think this control has inbuilt ability to
allow the user to click on the a row to select & highlight and highlight
this row.

I'd appreciate advice on this

Terry Holland


"Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi Terry,
>
> Welcome to ASP.NET newsgroup.
> REgarding on the CheckBoxList control's move item postion problem, here

are
> some of my understanding and suggestions:
>
> 1. For CheckedBoxList, it's can be populated either through manually

adding
> ListItems into its Items collection or using databinding to fill it.

After
> either approach, the binded items will be persisted in ViewState. And in
> serverside code we can use its "Items" collection to find a certain item
> and remove it or add new item.
> So for your question, move items up/down, I think it's possible, since we
> can remove a certain item first and use "insert" method to insert it to a
> new position (through the index parameter ).
>
> 2. Based on the means I mentioned in #1, we can move up/down items in
> checkedboxlist(of course, we need to carefully caculate the old/ new index
> of the item we want to manipulate). Another problem here is that how

can
> we mark the item the use select to move, since the checkedboxList control
> dosn't be designed to support this function, we may need to do some

further
> jobs to achieve it. For example, we can put a hidden field (<input
> type="hidden" ...>) on the page and use some client side script to log the
> item's index which user want to move.
>
> Thanks,
>
> Steven Cheng
> Microsoft Online Support
>
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
>
>
> --------------------
> | From: "Terry Holland" <(E-Mail Removed)>
> | Subject: CheckBoxList
> | Date: Tue, 2 Aug 2005 12:14:26 +0100
> | Lines: 16
> | X-Priority: 3
> | X-MSMail-Priority: Normal
> | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
> | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
> | Message-ID: <(E-Mail Removed)>
> | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
> | NNTP-Posting-Host: host202.multiserv.com 194.200.135.202
> | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
> | Xref: TK2MSFTNGXA01.phx.gbl
> microsoft.public.dotnet.framework.aspnet.webcontro ls:10226
> | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
> |
> | I have a webform with a checkboxlist control on it. This control is used
> to
> | indicate which 'child' objects are related to a 'parent' object. I

assign
> | by ticking and un-assign by unticking and then save the changes back to

my
> | database. This is all working well but I now want to add some extra
> | functinality. Users need to be able to select an item in the

checkboxlist
> | and move it up or down. Is this achievable using the checkbox list? ie
> can
> | I highlight the selected item in list and then move it up or down in the
> | list? I cant see any properties that would indicate that the selected
> item
> | can be highlighted or that I can indicate the position in the list that

I
> | want to add the item.
> |
> | tia
> |
> | Terry Holland
> |
> |
> |
>



 
Reply With Quote
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      08-04-2005
Hi Terry,

Thanks for your response. For the further question you mentioned, IMO,
DataGrid is a good one for displayed multi-column and customized data. Also
as for selecting , of course, it has buildin select feature let a user to
select a certain row. Though it didn't support buildin selection by double
clicking a row(generally we need to put a select button or link on each row
for seelction), we can manually provide such feature through some
clientside scripts. However, the main problem is that since DATAGRID is a
template databound control which can only populate data through databinding
and didn't expose such as "Items" collection like CheckedBoxList, so we can
not discretionarily modify individual item's index in all the items within
it. Thus, it's not quite possible for you to implement the move up/down
item function on using datagrid.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
| From: "Terry Holland" <(E-Mail Removed)>
| References: <(E-Mail Removed)>
<(E-Mail Removed)>
| Subject: Re: CheckBoxList
| Date: Wed, 3 Aug 2005 10:24:25 +0100
| Lines: 104
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| Message-ID: <#(E-Mail Removed)>
| Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
| NNTP-Posting-Host: host36.multiserv.com 194.200.135.36
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP14.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.aspnet.webcontro ls:10250
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
|
| I have a couple of problems with the CheckBoxList control which is leading
| me to look for a more appropraite control.
| Problem 1) In some instances I need to display more than one column of
| information
| Problem 2) The user need to be able to select a row and the control needs
to
| indicate which row is selected (like a list box does)
|
| With these problems in mind, is there a control that you would suggest?
The
| datagrid comes to mind but I dont think this control has inbuilt ability
to
| allow the user to click on the a row to select & highlight and highlight
| this row.
|
| I'd appreciate advice on this
|
| Terry Holland
|
|
| "Steven Cheng[MSFT]" <(E-Mail Removed)> wrote in message
| news:(E-Mail Removed)...
| > Hi Terry,
| >
| > Welcome to ASP.NET newsgroup.
| > REgarding on the CheckBoxList control's move item postion problem, here
| are
| > some of my understanding and suggestions:
| >
| > 1. For CheckedBoxList, it's can be populated either through manually
| adding
| > ListItems into its Items collection or using databinding to fill it.
| After
| > either approach, the binded items will be persisted in ViewState. And in
| > serverside code we can use its "Items" collection to find a certain item
| > and remove it or add new item.
| > So for your question, move items up/down, I think it's possible, since
we
| > can remove a certain item first and use "insert" method to insert it to
a
| > new position (through the index parameter ).
| >
| > 2. Based on the means I mentioned in #1, we can move up/down items in
| > checkedboxlist(of course, we need to carefully caculate the old/ new
index
| > of the item we want to manipulate). Another problem here is that how
| can
| > we mark the item the use select to move, since the checkedboxList
control
| > dosn't be designed to support this function, we may need to do some
| further
| > jobs to achieve it. For example, we can put a hidden field (<input
| > type="hidden" ...>) on the page and use some client side script to log
the
| > item's index which user want to move.
| >
| > Thanks,
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| > --------------------
| > | From: "Terry Holland" <(E-Mail Removed)>
| > | Subject: CheckBoxList
| > | Date: Tue, 2 Aug 2005 12:14:26 +0100
| > | Lines: 16
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1506
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506
| > | Message-ID: <(E-Mail Removed)>
| > | Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontro ls
| > | NNTP-Posting-Host: host202.multiserv.com 194.200.135.202
| > | Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP09.phx.gbl
| > | Xref: TK2MSFTNGXA01.phx.gbl
| > microsoft.public.dotnet.framework.aspnet.webcontro ls:10226
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontro ls
| > |
| > | I have a webform with a checkboxlist control on it. This control is
used
| > to
| > | indicate which 'child' objects are related to a 'parent' object. I
| assign
| > | by ticking and un-assign by unticking and then save the changes back
to
| my
| > | database. This is all working well but I now want to add some extra
| > | functinality. Users need to be able to select an item in the
| checkboxlist
| > | and move it up or down. Is this achievable using the checkbox list?
ie
| > can
| > | I highlight the selected item in list and then move it up or down in
the
| > | list? I cant see any properties that would indicate that the selected
| > item
| > | can be highlighted or that I can indicate the position in the list
that
| I
| > | want to add the item.
| > |
| > | tia
| > |
| > | Terry Holland
| > |
| > |
| > |
| >
|
|
|

 
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
Checkboxlist inside Repeater - doesn't fire click event for Checkboxlist JD ASP .Net 5 08-08-2007 11:28 AM
How to get Selected item in a Databinded CheckBoxList when CheckBoxlist is in a DataList? Patrick.O.Ige ASP .Net 5 06-19-2005 06:11 AM
Re: checkboxlist control Ignacio Martinez ASP .Net 1 06-30-2003 02:51 PM
Re: checkboxlist control Khan Imran ASP .Net 0 06-30-2003 01:36 PM
/!\ How to colorize selected checkbox in checkboxlist control ? Francois Verbeeck ASP .Net 0 06-24-2003 03:13 PM



Advertisments