Click here to Skip to main content
15,906,463 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionCoudl not get ListBox Value Pin
J Liang18-Jun-07 0:02
J Liang18-Jun-07 0:02 
AnswerRe: Coudl not get ListBox Value [modified] Pin
RepliCrux18-Jun-07 1:25
RepliCrux18-Jun-07 1:25 
GeneralRe: Coudl not get ListBox Value Pin
J Liang18-Jun-07 15:05
J Liang18-Jun-07 15:05 
AnswerRe: Coudl not get ListBox Value Pin
RepliCrux18-Jun-07 15:16
RepliCrux18-Jun-07 15:16 
GeneralRe: Coudl not get ListBox Value Pin
J Liang18-Jun-07 17:29
J Liang18-Jun-07 17:29 
GeneralRe: Coudl not get ListBox Value Pin
RepliCrux18-Jun-07 17:36
RepliCrux18-Jun-07 17:36 
GeneralRe: Coudl not get ListBox Value Pin
RepliCrux18-Jun-07 17:39
RepliCrux18-Jun-07 17:39 
GeneralRe: Coudl not get ListBox Value Pin
J Liang20-Jun-07 16:03
J Liang20-Jun-07 16:03 
Hi RepliCrux,

Been quite busy lately, only now I remember to put a reply here.

I got it working though, it seems the way the article said, the ID is already in the listbox, so when I pass the item to another listbox, the ID is already there and here is how I capture all the ID.

for (int i = 0; i < this.lstToUser.Items.Count; i++)
{
if (this.lstToUser.Items[i].Selected == false)
{
this.lstToUser.Items[i].Selected = true;
userlist.Add(this.lstToUser.SelectedValue);
this.lstToUser.Items[i].Selected = false;
}
else
{
userlist.Add(this.lstToUser.SelectedValue);
this.lstToUser.Items[i].Selected = false;
}
}

By giving a command to the list box to select one by one every item in the list and add it into the list item by using this.lstToUser.SelectedValue since the value is suppose to be holding the IDs, then I'll deselect it and select the next one.

But before this we need to do

for (int i = 0; i < this.lstToUser.Items.Count; i++)
{
this.lstToUser.Items[i].Selected = false;
}

To deselect everything in the list box before starting to capture the ID.

This might look strange but at least it works for the mean time Poke tongue | ;-P

J Liang
Questiondialog box Pin
niki_nilu17-Jun-07 23:51
niki_nilu17-Jun-07 23:51 
AnswerRe: dialog box Pin
N a v a n e e t h17-Jun-07 23:56
N a v a n e e t h17-Jun-07 23:56 
GeneralRe: dialog box Pin
niki_nilu18-Jun-07 0:03
niki_nilu18-Jun-07 0:03 
GeneralRe: dialog box Pin
Revathij18-Jun-07 0:24
Revathij18-Jun-07 0:24 
GeneralRe: dialog box Pin
N a v a n e e t h18-Jun-07 0:27
N a v a n e e t h18-Jun-07 0:27 
GeneralRe: dialog box Pin
niki_nilu18-Jun-07 1:45
niki_nilu18-Jun-07 1:45 
GeneralRe: dialog box Pin
N a v a n e e t h18-Jun-07 17:49
N a v a n e e t h18-Jun-07 17:49 
QuestionRefreshing User Control Pin
wEb GuRu...17-Jun-07 23:19
wEb GuRu...17-Jun-07 23:19 
AnswerRe: Refreshing User Control Pin
N a v a n e e t h17-Jun-07 23:43
N a v a n e e t h17-Jun-07 23:43 
QuestionRe: Refreshing User Control Pin
wEb GuRu...17-Jun-07 23:47
wEb GuRu...17-Jun-07 23:47 
AnswerRe: Refreshing User Control Pin
N a v a n e e t h17-Jun-07 23:55
N a v a n e e t h17-Jun-07 23:55 
GeneralRe: Refreshing User Control Pin
wEb GuRu...18-Jun-07 0:07
wEb GuRu...18-Jun-07 0:07 
GeneralRe: Refreshing User Control Pin
N a v a n e e t h18-Jun-07 1:07
N a v a n e e t h18-Jun-07 1:07 
QuestionCurrent Password field(text box ) to be checked against the value stored in database Pin
Hemant Garg17-Jun-07 22:51
Hemant Garg17-Jun-07 22:51 
AnswerRe: Current Password field(text box ) to be checked against the value stored in database Pin
N a v a n e e t h17-Jun-07 23:06
N a v a n e e t h17-Jun-07 23:06 
GeneralRe: Current Password field(text box ) to be checked against the value stored in database Pin
Hemant Garg18-Jun-07 0:35
Hemant Garg18-Jun-07 0:35 
AnswerRe: Current Password field(text box ) to be checked against the value stored in database Pin
koolprasad200317-Jun-07 23:50
professionalkoolprasad200317-Jun-07 23:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.