Anyone know how to disable the scrollbar from a listbox, so that when the listbox is refresh, it doesn't reset the scorllbar to the top of the list?
Thanks,
NewKid
Hi,
I am not exactly sure if I understood your question. What do you mean by "Listbox is refreshed"? Does it mean a postback? Also can you further elaborate on "reset the scrollbar to the top of list"?
I am asking this because I interpreted your question as : You have an List Box Server Control on a WebForm which has some values. So, when you postback the Page the Scroll position of the Listbox goes to the top of the control. I tried replicating the same scenario, where I created a ListBox and filled it with some values so that the scrollbar of the ListBox is visible. Then I would select a value by scrolling down and then postback the page by clicking on a button. However when the page was reloaded the scrollbar of the listbox was properly in place at the selected value right at the bottom. So I failed to understand what your problem was. Haven't you set the EnableViewState property to true?
Please Elaborate a bit further on your problem. Also tell how are you filling the ListBox.
Good Luck
Regards
Vineed
Sorry about that...
I meant a ListView. I have a listview that retrieve data from a server and list the data on the the listview. I have a refresh button that refreshes the listview(Note: It basically retrieves data from the server and relist it on the listview). But when thet occurs, the listview scroll bar will reset to the top of the list, if you had move the scrollbar down to a certain point.
ALl of this is done in VB.net....and there is no webform .....
Thanks,
Newkid
Hi,
Is this problem you are talking about related to Windows Forms? If Yes, then I would recommend you to post this query on the MSDN forums which has a seperate forum for VB.Net as well as Windows Forms. As far as the question is related, I am sorry to say that I may not be able to help you since I am a ASP.Net Developer and I do not have much knowledge about Windows Forms.
Good Luck!
Regards
Vineed
0 comments:
Post a Comment