|
-
May 7th, 2003, 03:37 PM
#1
Thread Starter
Sleep mode
ListBox1.SelectedItem ??
I admit it that this bug is getting me crazy !!aaah . I've been using it this way all the way long but today I don't understand what's wrong (no bindings at all) ! It shows me this value as msgbox :
System.Data.DataRowView
I always use this way !
MsgBox(ListBox1.SelectedItem.ToString)
Can anyone figure out what's up !
-
May 7th, 2003, 03:51 PM
#2
Member
Hi,
i have seen that problem too... it is in the databinding....but I do not remember what i did to fix it. i think i remember that you had to in source associate only with the dataset then in the datamember associate with the ttable and the column...
but I have been frustrated with it too.
anyone know exactly why it does this?
Tal McMahon
its called the "F1" key-- use it
-
May 7th, 2003, 03:54 PM
#3
Thread Starter
Sleep mode
I hate this word "DataBinding" so I would never use it !
-
May 7th, 2003, 04:56 PM
#4
Whether you bound the control or just filled the the items collection, you put a DataView or Rows in there and that is what they return from a ToString call. Try using SelectedText instead or setting the Displaymember property to one of the field names.
-
May 7th, 2003, 05:07 PM
#5
Thread Starter
Sleep mode
It doesn't make any difference . I did that and went further to get selecteditem based on selectedindex with no luck . This is the first time I get such error . btw , I'm having this listbox in a panel , Do you think (well I don't...lol ) it's causing problems ?
-
May 7th, 2003, 05:28 PM
#6
What didn't make a difference? The displaymember? Or SelectedText?
Also post your offending code as well as the code you are using to fill the listbox.
-
May 7th, 2003, 07:23 PM
#7
Lively Member
maybe....this.....
I think you couldn't get the text which selected in the listbox, am I correct? If YES....
Maybe you can try this code...
VB Code:
msgbox(ListBox1.GetItemText(ListBox1.SelectedItem))
-
May 8th, 2003, 05:07 PM
#8
Thread Starter
Sleep mode
I'm using the same code which was taken from another working project . The function is correct I'm quite sure . I checked every line to see if there is something wrong but still can't get it to work . It's kind of weird bug . I'll wait till I buy this VS.NET2003 and finish my project agains 1.1 version . thanx thought for your reply !
-
May 8th, 2003, 05:08 PM
#9
Thread Starter
Sleep mode
Re: maybe....this.....
Originally posted by chinhow
I think you couldn't get the text which selected in the listbox, am I correct? If YES....
Maybe you can try this code...
VB Code:
msgbox(ListBox1.GetItemText(ListBox1.SelectedItem))
Same error !
-
May 8th, 2003, 06:08 PM
#10
Fanatic Member
post your code where you put the data in the listview
-
May 9th, 2003, 02:40 PM
#11
Thread Starter
Sleep mode
There is no listview . I used Listbox .
-
May 9th, 2003, 05:42 PM
#12
Fanatic Member
-
May 9th, 2003, 10:32 PM
#13
Thread Starter
Sleep mode
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|