Thanks for your response. I do have a label which says default value is selected when the conditions are met. But that doesn't help much. I do need to show the list item selected in the disabled lisbox, I have tried to include some client side javascript code (to change the selected item and disable the checkbox) but it didnt help either. It doesn't show the selected item in the disabled listbox.
Sure, please let me know if you have better approach for this. Thanks for your help. >From: Ronda K <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Re: [AspNetAnyQuestionIsOk] Showing Selected Item in the disabled >listbox?? >Date: Mon, 11 Oct 2004 22:58:16 -0500 > >You could do a couple things that come to mind. > >1) Not sure if this will work because I am not certain if you can >apply a CSS to a specific item BUT if you could then you could make >the selected item bold or italic or have a different background color > >2)Perhaps not the solution you were looking for but you could place a >label above your disabled box and add text to the label if all >conditions were met "You previously selected X" or something like >that. Not the most aesthetic solution... but it would accomplish what >you wanted. > >If neither of those make you happy let me know and I will make a list >box tomorrow and come up with some other ideas. > >Ronda Pederson >MVP ASP.Net > >On Mon, 11 Oct 2004 19:47:13 +0000, Vidya Puppala ><[EMAIL PROTECTED]> wrote: > > > > Hi Ronda, > > > > Thanks for your response. Here is the code if it helps to see what I am > > doing. > > > > If chk.Checked Then > > Dim li As New ListItem > > li = CType(lc, ListBox).Items.FindByValue(ValueId) > > If Not li Is Nothing Then > > lc.ClearSelection() > > CType(lc, ListBox).Items.FindByValue(ValueId).Selected = >True > > lc.Rows = 1 > > End If > > lc.Enabled = False > > End If > > > > Here, when the page is rendered, although the value is selected, it is >not > > shown chosen. i.e, For example: I have 10 List items populated to lc >(the > > listbox), after the page is rendered, i see the disabled listbox with >shows > > the first item in the listbox... i want to show the selected value >instead. > > > > There were some suggestions that I could move the selected item to the >top > > in order to show that its selected. I donot want to do this because it > > changes the order of the listitems. Let me know if you have a better >idea. > > > > Thanks a bunch. > > > > >From: Ronda K <[EMAIL PROTECTED]> > > >Reply-To: [EMAIL PROTECTED] > > >To: [EMAIL PROTECTED] > > >Subject: Re: [AspNetAnyQuestionIsOk] Showing Selected Item in the >disabled > > >listbox?? > > >Date: Fri, 8 Oct 2004 15:12:45 -0500 > > > > > >Couldn't you just pass in a condition that if the checkbox was checked > > >... to set one of the listitems to selected=true .... List would still > > >be disabled but one item would be selected. I think that would work > > >although I have never tried it. > > > > > >Ronda > > > > > > > > >On Fri, 08 Oct 2004 19:52:31 +0000, Vidya Puppala > > ><[EMAIL PROTECTED]> wrote: > > > > > > > > I have checkbox when checked disables the lisbox from user >selections > > >and > > > > selects a default value in the listbox. The listbox when disabled > > >retains > > > > the Selection information (default value selected) and the listbox >no.of > > > > rows changes to 1. If the checkbox is unchecked, it shows the >respective > > > > selection information and the listbox rows is changed back to its > > >original > > > > no.of rows (4). > > > > > > > > We do have a problem here. When the checkbox is checked and the >listbox > > >is > > > > disabled, I want to show the selected item, so the user know the >default > > > > value selected, even though the list box is disabled. > > > > > > > > Please let me know if anyone knows how to get around it. Any help is > > >greatly > > > > apppreciated. > > > > > > > > Thanks a bunch. > > > > > > > > _________________________________________________________________ > > > > FREE pop-up blocking with the new MSN Toolbar â€" get it now! > > > > http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/ > > > > > > > > > > > > > > > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > >-- > > >Ronda Pederson > > >MVP ASP.Net > > > > _________________________________________________________________ > > Express yourself instantly with MSN Messenger! Download today - it's >FREE! > > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ > > > > > > Yahoo! Groups Links > > > > > > > > > > > > >-- _________________________________________________________________ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ ------------------------ Yahoo! Groups Sponsor --------------------~--> $9.95 domain names from Yahoo!. Register anything. http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
