|
Hi,
I'm using this control (multiples actually) to populate information but when I click on a Button that is not part of the PickList and the screen refreshes, it strips the ItemsLeft and ItemsRight viewable text and replaces it with the value instead.
For example my list may contain stuff like "EX1234 (On test)" but after postback it states just "EX1234", which is the actual value I record, not the view text!
Any ideas?
I've tried to capture each ItemList into a separate ItemList and then clear and read those back into the PickList, but no joy....
I've remembered that I'm actually using V1 of this control, but this question will probably apply to V2 also, unless the bug (listed on V1's discussion section) has been removed in this one?
For info, I've used a DataReader to grab values from SQL2000 using Data Access Application Block V1 from MS and its "ExecuteReader" method to supply connection & query. I then read through the DataReader and assign Text and Value to a DataItem then add the DataItem to the ItemsLeft Collection of the control. Like I say, works fine on PageLoad and looks nice, but if another button on screen is clicked (which I use to transfer ItemsRight to somewhere else), then both Item lists have their Text values changed for their Value values, if you see what I mean?
|
|
|
|
|
Sorry - I should have really checked out PickList2 before committing the bug report..!
PickList2 works fine as intended. I have however made 2 small adjustments to the Client JS that makes the interaction a little easier (for me anyways) by re-foucsing the List box you select from and highlighting the next available List Item:
In the function moveSelected, find the line:
option_count_from = from_select.length;
and add (underneath it):
selected_item = from_select.selectedIndex;
further on in the same function, find
s+= "sortMover(to_select);";
s+=
@"}
and add (underneath it):
from_select.selectedIndex = selected_item;
To me, this makes the UI a little bit more intuitive. Perhaps these mods could be inclded in the design interface as something like "SelectNextItem: TRUE/FALSE", but I'm not up on changing webcontrols that much....
Thought you'd like to know my mod anyways. Thanks for an improvement on what already is a super control!!
|
|
|
|
|
I found a bug that prevents the picklist control from working inside a usercontrol
The problem will be solved patching the method CreateChildControls() as below:
Old lines
protected override void CreateChildControls()
{
string LeftListBoxID = this.UniqueID+ "_Left";
string RightListBoxID = this.UniqueID+ "_Right";
Updated lines
protected override void CreateChildControls()
{
string LeftListBoxID = this.ClientID + "_Left";
string RightListBoxID = this.ClientID + "_Right";
|
|
|
|
|
Hey. I'm getting an error at (seemingly) the line:
option_count_from = from_select.length;
in the moveSelected() method. The exception message is simply "Object Required".
Has this been seen by anyone else?
It happens when I try to move an item from left to right. I'm in IE6.
any help would be greatly appreciated!
|
|
|
|
|
There's something wrong with my FormID property I think. I've set it to equal the ID property of the tag the Picklist is enclosed within. Is this not correct?
|
|
|
|
|
Hi!
I encountered the same error. Also in IE6.
Have you already found a solution for it?
Gloki
|
|
|
|
|
Ok, I found the solution.
The problem was that I've used ASP.NET with a Masterpage and there the Control has problems with the ID's.
fzardoya has already posted a solution for usercontrols. This solution works also for the MasterPage problem.
fzardoya wrote: I found a bug that prevents the picklist control from working inside a usercontrol
The problem will be solved patching the method CreateChildControls() as below:
Old lines
protected override void CreateChildControls()
{
string LeftListBoxID = this.UniqueID+ "_Left";
string RightListBoxID = this.UniqueID+ "_Right";
Updated lines
protected override void CreateChildControls()
{
string LeftListBoxID = this.ClientID + "_Left";
string RightListBoxID = this.ClientID + "_Right";
|
|
|
|
|
Works fine for me in IE, but not in Firefox.
When I postback and loop over the contents of the right listbox, none of the items I moved from the left pane show up:
For Each li As ListItem In Me.PickList2.ItemsRight
'in firefox, none of the items moved from the left side show up
Next
Any thoughts? I'm presuming this is a javascript issue.
--Frank
|
|
|
|
|
Ah, found the solution... which is also listed in the comments for the old pick list
( http://www.codeproject.com/aspnet/DblPanePickList.asp )
Need to replace this line:
lobjAantal = document.getElementById(pstrLeftItems);
with this one:
lobjAantal = document.getElementsByName(pstrLeftItems)[0];
|
|
|
|
|
Strange error. during design time, when the control is on a panel that's inside a panel, almost every other time VS 2003 both sp1 and not sp1 will dispaly an error:
Error Creating Control
The tip says 'A control cannot modify its parents' control collection'.
Since it doesn't happen consistently, there has to be a race condition going on.
tough one.
|
|
|
|
|
In general I like what you have done! But it seems you are trying to make more than one control in one package. It may make more sense to have one control with normal buttons and more functionality(i.e. SelectedValue, SelectedIndex, Databindings for the list) then clone a fully tested version of it and refactor it into a second control that uses imagebuttons or hyperlinks. Just a thought. Thanks again.
-- modified at 7:17 Wednesday 26th April, 2006
|
|
|
|
|
Hi,
First of all congrats for a great work!!! You did a really good job.
I have got it running perfectly fine.
I would like to know how do i get the selected values?
Like i have moved Two Items from left box to Right Box. How do i get those two values?
Is there any property you have exposed for it?
Thanks.
SunSmile
|
|
|
|
|
The functionality looks great, but I think I am missing something. The zip file contains a CS file but no .ASPX file (or .ASCX), but it says it is a asp.net control?
How do I implement this?
Thanks!
Russ
|
|
|
|
|
It's a control used in VS.NET...it should appear in the toolbox once you make reference to it then drag and drop it onto your pages. Simple explanation, I admit, but suffice?
|
|
|
|
|
Hi i want to use PickList2.0 on a WebControl .but how i can retrieve FormID?
|
|
|
|
|
You get it form the form tag,
Example:
FormID="Form1"
In fact, I should remove the necessity for this property, may when I have a little time..
i386 the technology source
http://www.i386.com
|
|
|
|
|
Because of some reasons i can not use tag in my control.
|
|
|
|
|
If you only define one form (99% of Web Forms) you can set the FormId to the first form on the document:
FormID="forms[0]"
Javascript will then access the form that way: form = document.forms[0];
It works fine for ASP.NET 1.1 and 2.0.
|
|
|
|
|
I dont want buttonUp and buttonDown!!!
|
|
|
|
|
IsMoveItemLeft=false IsMoveItemRight=false
Gavin
i386 the technology source
http://www.i386.com
|
|
|
|
|
i have not System.Web.UI.Design ?
|
|
|
|
|
please, I need dll, my Vs 2003 not compile your code "System.Web.UI.Design".
Thanks,
Raide
|
|
|
|
|
Yes, my computer also cannot compile "System.Web.UI.Design", please dll
|
|
|
|
|
Please add refrence to "System.Design".
|
|
|
|
|
Go ahead, I'll be watching. A good example of inheritance on another level.
|
|
|
|