|
Hey guys
i need my listBox items to be editable in the listBox itself.
For example, the user clicks a button "add roster", then a blank item appears in the list box where the user can type its name directly inside the item... and then when focus is lost adds that item to the list.
It seems the normal System.Windows.Forms.ListBox cant do it like that... unless im missing something?
are there any good 3rd party ListBoxes that can help me with this? any other suggestions are welcome
Thanks
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
There's a few in articles[^] on here Harvey. I think the standard way of doing this it to get overlay a textbox on the field that needs editing and remove it on enter or lost focus (obviously saving the data first).
It is possible to embed controls in the list view (again a few articles) but that can be pretty memory intensive in a large list.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Expect everything to be hard and then enjoy the things that come easy. (code-frog)
|
|
|
|
|
Thanks dave
I'll have a look
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
Hi
Have you tried listview.
No databinding, but otherwise perfect
Kjetil
|
|
|
|
|
Hey Kjetil
i found this[^] and it seems like its going to do what i need it to
Thanks for replying though
Harvey Saayman - South Africa
Junior Developer
.Net, C#, SQL
you.suck = (you.Passion != Programming & you.Occupation == jobTitles.Programmer)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
You can switch to ListView and set .View = View.List;
Then use ListView's label editing feature.
private void button2_Click(object sender, EventArgs e)
{
var item = listView1.Items.Add("");
listView1.LabelEdit = true;
item.BeginEdit();
}
private void listView1_AfterLabelEdit(object sender, LabelEditEventArgs e)
{
listView1.LabelEdit = false;
}
Greetings - Gajatko
Portable.NET is part of DotGNU, a project to build a complete Free Software replacement for .NET - a system that truly belongs to the developers.
|
|
|
|
|
Hello
1) ComboBox is Visible False
2) When User Click on TextBox, i am Changing the Visible State of Combo to True
3) Now I am trying to Set Focus on Combo Box But It will not doing so.
--- cmbCity.Focus();
Any Way to Solve my Problem
Best Regards,
Chetan Patel
|
|
|
|
|
Focus() should work. You might be doing something else wrong. Which event you are handling for textbox?
|
|
|
|
|
Hi,
How to print dataGridview1?
kindly give method or sample links.
Thank you in advance
(Riaz)
|
|
|
|
|
|
Hi,
i have a simple c# application which calls a public webservice and sends few data to it.
Is there any official way how to cache this request when there is no network connection?
So the request will be done automatically when the device is online.
Thanks
|
|
|
|
|
You could poll network availability and create request when network is available. This will be better than caching the request and waiting for network availability.
|
|
|
|
|
thank you. your way is good but the request is generated from user. and the user doesn't wait till network is available. he is just generating many requests and they have been to be stored, so they can be send later when network is online.
|
|
|
|
|
Member 827613 wrote: and the user doesn't wait till network is available. he is just generating many requests and they have been to be stored
Add the requests to a List<T> . When the network available, iterate this list and send each one. If you want to persist the list contents when the close the application, use BinaryFormatter class and write the object to a binary file. Load from the file next time your application starts so that you won't miss any requests.
|
|
|
|
|
Ah you mean to store the 'data' and not the request. Then just generate webservice requests and post the stored data.
ok this is very good manual solution of my problem which i wanted to avoid
In other words your answer of my question is 'do it yourself' :P
But it seems that i don't have any other option so thanks.
|
|
|
|
|
Member 827613 wrote: ok this is very good manual solution of my problem which i wanted to avoid
Why? Implementing what I said is trivial or I got your question wrong?
|
|
|
|
|
Its ok. Its just takes time to implement, nothing more
But maybe i just wasted more time to search for a ready robust framework instead of start coding it.
|
|
|
|
|
|
This sounds very mighty. Thanks.
|
|
|
|
|
Hi all,
I want to start a service controller. So I call Start() member of the ServiceController class. Sometimes it gives an error, saying that
application has generated an exception that could not be handled
I use try-catch block to detect simple Exception caught. Even it's not found that exception. I'm really wired with this, please help me to solve this.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
EventViewer will have an entry about the error. Check it.
|
|
|
|
|
Yes it's. But it's confusing me too.
The description for Event ID ( 0 ) in Source ( .NET Runtime ) cannot <br />
be found. The local computer may not have the necessary registry<br />
information or message DLL files to display messages from a remote <br />
computer. You may be able to use the /AUXSOURCE= flag to retrieve this <br />
description; see Help and Support for details. The following information is<br />
part of the event: .NET Runtime version 1.1.4322.573- serverautomate.exe - <br />
Common Language Runtime Debugging Services: Application has generated an <br />
exception that could not be handled.<br />
<br />
<br />
Process id=0xc4 (196), Thread id=0xd38 (3384).<br />
<br />
<br />
Click OK to terminate the application.<br />
Click CANCEL to debug the application..<br />
I appreciate your help all the time...
CodingLover
|
|
|
|
|
I don't have any idea. Try google[^]
|
|
|
|
|
Hi all ..
I'm trying to save an image from memory stream content.
but getting error like "Parameter is not valid." at newImage = System.Drawing.Image.FromStream(ms);
can you please suggest me.
Here is my code..
System.Drawing.Image newImage;
using (MemoryStream ms = new MemoryStream(photoByte, 0, photoByte.Length))
{
ms.Write(photoByte, 0, photoByte.Length);
newImage = System.Drawing.Image.FromStream(ms);
newImage.Save(strFileName);
img.Attributes.Add("src", strFileName);
}
Thanks
siri
|
|
|
|
|
After writing to the stream you have to reset the position to the beginning of the stream before reading it.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|