|
lol... those properties don't exist. So we are not speaking the same language.
I'm using Visual Studio 2005 2.0 Framework C#
I'm speaking of DataTextField, DataValueField on a ListBox.
However I tried DisplayMember, and ValueMember
But that didn't work either. I still get the namespace showing up in two records, instead of columned names.
Remember guys I'm not using a dataset... I'm using a <list> array.
|
|
|
|
|
The DataSource accepts more than just a DataSet or DataTable. The DataSource property accepts anything that implements IListSource, IEnumerable....
Below is what I tried and it worked for me. Try again.
public class Customer
{
public Customer(string name, int id)
{
this.name = name;
this.id = id;
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private int id;
public int Id
{
get { return id; }
set { id = value; }
}
}
protected void Page_Load(object sender, EventArgs e)
{
List<Customer> customer = new List<Customer>();
customer.Add(new Customer("John", 1));
customer.Add(new Customer("Mike", 2));
customer.Add(new Customer("Freddy", 3));
this.ListBox1.DataSource = customer;
this.ListBox1.DataTextField = "Name";
this.ListBox1.DataValueField = "Id";
this.DataBind();
}
|
|
|
|
|
for one this I want a multi-column listbox... with
the fields to show up in columns...
This is capability only in later versions of .NET probably not what you are using. Thanx for your help though...
That's just not going to populate columns.
|
|
|
|
|
Are you doing a WinForms App?
If so, then you are either using a third-party listbox control that has columns, and in that event you should ask on their website, or you are using a ListView and should have said so.
Is it a web App?
If so, search for 'Display Multiple Columns in a List Box Sample' and follow the links available from there.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi,
Does anyone know of a way to embed a progress bar into a node of a treeview?
Thanks.
-Jamie
|
|
|
|
|
I don't think you can do this directly. Although, you can add a ProgressBar to a TreeView using treeView1.Controls.Add(new ProgressBar()) or by drag drop in design view. Then, you will have to manage to position over a node.
Real dirty way IMO.
जय हिंद
|
|
|
|
|
Hello
i'm using Visual Studio C# 2008 Express
i'm working on a large school assignment along with other two people; there's a computer for each one of us obviously.
we installed the same VS version and we have been working nicely until yesterday, when a weird error ocurred only at two of us.
it happened when we updated our files with everyone's information and tried to test it. this is the code which shows the error...
private void UnlockBitmap()
{
_bitmap.UnlockBits(_bitmapData);
_bitmapData = null;
pBase = null;
}
and this is what it says
No se controló System.ArgumentException
Message="Parameter is not valid."
Source="System.Drawing"
StackTrace:
at System.Drawing.Bitmap.UnlockBits(BitmapData bitmapdata)
at Vision.SeLUT.UnlockBitmap()
at Vision.SeLUT.Finalize()
InnerException:
where Vision is out proyect and SeLut is a class we made to handle bitmaps
this message always appear while testing the application, but just to two of us:
sometimes the execution crashes, sometimes it doesn't, but the actual last-one-to-modify-the-files does not has this problem
since we all now have the very same files...
does anyone has any idea of what is happening and how to solve it?
thanks in advance
|
|
|
|
|
Hi,
I suggest you don't share binary files such as .obj and .exe and .dll while developing; just share source files, and built on every machine. Also use a debug build, so an Exception shows line numbers, and tell Visual Studio to show line numbers in all its editor windows. Finally try a "rebuild all" since you most likely have an inconsistent set of files on at least one machine.
Obviously, when things settle down, you can switch to release build, and distribute .exe/.dll files rather than source files. Or create an installer app.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hello guys.
I'm going to send data to USB with C#.
I've already searched Google for it ! But I couldn't find what I want.
Could you guide me ?
Thanks in advance.
|
|
|
|
|
|
Hi,
normally you don't talk to a bus such as USB, you talk to devices attached to the bus.
Also normally the USB device comes with a driver, hence your app communicates with the driver in accordance with the driver's documentation.
If you happen to build your own USB device you should consider writing your own device driver, not a beginners job. And you may be interested in this stuff[^] which I haven't looked into yet.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Luc Pattyn wrote: normally you don't talk to a bus such as USB, you talk to devices attached to the bus.
So we have to work with Serial Port ?
|
|
|
|
|
serial port is not a bus, it typically is a point-to-point connection. And it is very old, it often got used without any specific protocol.
Do you talk to Ethernet? by definition every bus has one (or several) protocols running on it, and any decent OS would provide drivers that implement such protocols.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
have you seen this blog?[^].
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
I have this query, but I need the flat result. Like
c.id, c.CoverCode, c.Premium, ..., cv.CoverageCode
any idea???
From c In Covers _
Join cv In Coverages On c.PolicyKey Equals cv.PolicyKey And c.CoverNumber Equals cv.CoverNumber _
Where c.PolicyKey = 3441028 _
Select New With {c, cv.CoverageCode}
|
|
|
|
|
Did you know that we have a 'LINQ and .Net 3.5' forum?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hi. I'm running an ASP.NET C# web application. I have a website including some textboxes with a button for editing of some data in my db, and also a datalist for displaying the same data from the db. My trouble is to update both AJAX UpdatePanels with the updated data. The UpdatePanel with the datalist always seem to stay one step behind.
There is a lot of code to copy/paste, but shortly its build up something like this:
website
UpdatePanel1
textboxes and button1 for updating data
/UpdatePanel1
UserControl
UpdatePanel2
datalist to display data from db
/UpdatePanel2
/UserControl
/website
When clicking button1 gode is run as follows:
1. website Page_Load
2. UserControl Page_Load
3. website Button1_click
This means that my UserControl reads from the db before the changes are done in the Button1_Click. Both UpdatePanels are updated. UpdatePanel1 with the new data changed with Button1_click, while UpdatePanel2 still shows the old db data. With saveing changes several times with button1, UpdatePanel2 gets updated with the new data, but it always stays one stem behind.
Now what I've figured needs to be done, is to run the code of Button1_Click before UserControl Page_Load. Something like this:
1. website Page_Load
2. website Button1_click
3. UserControl Page_Load
Is there a way? I can't make it, and I'm soon going crazy.
Any suggestions would be appreciated. Thank...
|
|
|
|
|
You might get a quicker/better response if you had posted the question in the 'ASP.Net Forum'.
You might get lucky here, but chances are that you won't.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
|
Sorry. I'll post over there. Thanks though....
|
|
|
|
|
|
This is a C# programming forum. If you are too idiot to notice that, you are probably too idiot to find anything on Google
|
|
|
|
|
Le Centriste wrote: This is a C# programming forum. If you are tooto idiotstupid to notice that, you are probably tooto idiotstupid to find anything on Google
There you go
|
|
|
|
|
EliottA wrote: This is a C# programming forum. If you are toototoo idiotstupid to notice that, you are probably toototoo idiotstupid to find anything on Google
there you go
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
musefan wrote: This is a C# programming forum. If you are toototoo idiotstupid to notice that, then you are probably toototoo idiotstupid to find anything on Google.
you are too idiot musefan
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|