|
-
Jan 16th, 2008, 03:10 PM
#1
Thread Starter
Member
jjjjjjjjjjjjjjjjjjjjjjjjjjj
Last edited by sharonnet; Apr 2nd, 2008 at 11:44 AM.
-
Jan 17th, 2008, 01:19 AM
#2
Re: How do i get the value from the list in label?
CSharp Code:
this.BindingSource1.DataSource = myObj.GetDepartmentsByUserID(); this.Label1.DataBindings.Add("Text", this.BindingSource1, "SomeProperty");
That will then display the value of the SomeProperty property of your list items in the Label. To navigate the list you would set the Position property of the BindingSource or call a method like MoveNext.
That said, your code makes no sense to me. Why does your method have two arguments that never get used?
-
Jan 17th, 2008, 09:42 AM
#3
Thread Starter
Member
Re: How do i get the value from the list in label?
My UI code is in VB not in c# where i am binding the lable.Can you please give me the code in vb?
-
Jan 17th, 2008, 10:59 AM
#4
Re: How do i get the value from the list in label?
How hard is it to convert that? This becomes Me, remove the semi colons, you're done.
-
Jan 17th, 2008, 02:45 PM
#5
Thread Starter
Member
Re: How do i get the value from the list in label?
It's VB.net.We don't have DataBindings and BindingSource in VB.Net
-
Jan 17th, 2008, 05:03 PM
#6
Re: How do i get the value from the list in label?
You wouldn't happen to be making a web application, would you?
-
Jan 17th, 2008, 05:47 PM
#7
Re: How do i get the value from the list in label?
 Originally Posted by sha_shivani
It's VB.net.We don't have DataBindings and BindingSource in VB.Net
Of course you do. They're both part of the .NET Framework so they "exist" in every .NET language, whether that be C#, VB, C++, J#, Delphi or whatever.
That said, they are both specific to Windows Forms, so if you're creating a Web app, as mendhak suggested, then you won't have access to the BindingSource class or the DataBindings property.
It's important to provide all the relevant information when you post. You've posted in the C# forum so of course people will respond with C# code. If you want VB code then you should either be posting in the VB forum or at least telling us that your using multiple languages and need this code in VB. Given that this site has an ASP.NET forum, if you post in a language forum then people are going to assume that it's Windows Forms in most cases. Please provide a full and proper description of your issue from the start in future to avoid wasting our time and yours.
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
|