|
Hi,
I've a combo box, which contains Sites' names(data comes from database). One of the item is "Create new site". I would like to keep the "Create new site" item at the top of all items. I tried to accomplish this by setting SelectedValue to 0, But it didn't work. Below is my code. Please guide to solve this issue. Thanks in advance.
DataTable dtSite = new DataTable();
DataRow drNewAction;
dtSite = objSites.SelectSites();
drNewAction = dtSite.NewRow();
drNewAction["SiteKey"] = 0;
drNewAction["SiteName"] = "Create new site";
dtSite.Rows.Add(drNewAction);
comSiteList.DataSource = dtSite;
comSiteList.DisplayMember = "SiteName";
comSiteList.ValueMember = "SiteKey";
comSiteList.Tag = "Loaded";
comSiteList.SelectedValue = 0;
|
|
|
|
|
Not sure I understand what you mean by "top of all items". But ComboBoxes will display the list in the exact order they are added to the list - unless you set the sorted property. Even if you have a sorted property you can trick the combo box by starting the item text out with a character that has an ascii value less than 65, like a space or a perenthesis. This will keep the item you want at the top of the list.
Brent
|
|
|
|
|
how can i make shortcut keys in code for examole if i press F1 then some page has to redirect or open. can any one help me plzzz
Regards,
S.Inayat Basha.
|
|
|
|
|
|
Hi,
there are two ways:
1.
the easy one: give your Form a MainMenu or MenuStrip and make sure the actions you want are present in the menus; all it takes to create shortcuts is setting their corresponding ShortCut property.
2.
the harder way (also for the user as he has no clue what shortcuts are available): let your Form preview the keyboard (Form.KeyPreview) and give it a KeyDown handler. No need to process the keys for each individual Control on the form!
|
|
|
|
|
Hi,
I'm trying to update my webconfig at runtime throught the .cs file.
This us the code i want to edit:
<br />
<identity impersonate="true" userName="SomeUser"<br />
password="Password"/><br />
I want to chage the value off "SomeUser" and "Password" to veriables such as,
txtserName.text and txtPassword.text.
Can i do it?
Please help...
modified on Monday, December 21, 2009 10:21 AM
|
|
|
|
|
Can someone please help me with this?
|
|
|
|
|
Hi All
How do I know if the text(string) is written in the in TextBox in C# Windows Application
Is From Barcode Reader or From user of the system .
thanks
Thaer
|
|
|
|
|
Could you clarify your question with some more detail...
Thanks
Md. Marufuzzaman
Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you.
I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.
|
|
|
|
|
Depending upon the code base you have, you probably can't directly, as once the the barcode is in the text box, it is just a string.
You have a couple of options, depending upon why you care that the reader is the source.
1. Record the fact the barcode has been read by a reader when the reading has been done (Reliable)
2. Check that the textbox text is in the form of a barcode number, assuming you have one. This isn't reliable, as the user could enter the number directly or it could come from another source.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
Some barcode scanners have the ability to add a delimiter character to the start or end of the string the read will return.
You can then check for this delimiter character to see if it came from your reader.
|
|
|
|
|
Hey guys
As you may or may not know I've been busy working on a scalable asynchronous TCP server... After previous suggestions here in the forums I've succeeded more or less
My only problem right now is that sometimes, usually when I try to send a packet to a 2nd or 3rd client (my server is just echoing at the moment) I get an exception:
A non-blocking socket operation could not be completed immediately
Googling around it seems that this is a non fatal exception and quite normal for asynchronous TCP communications...
My question is how should I handle this?
Thanks
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
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,
i want to get the modified registry old information like version, if deleted then i want to know the deleted registry key display name. pls help me out..
vinoth kumar
|
|
|
|
|
Can't be done. The Registry has no versioning or history support. There is no practical way to do what you want.
|
|
|
|
|
Actually i want after the installation/ uninstallation completion i want to get the product name and version information is this possible, or is there any other way available?.. pls help me out.
vinoth kumar
|
|
|
|
|
So you're looking for the changes that the installation and then uninstall of an application makes to the registry??
You'd need to take a snapshot of the registry, building a database of all the keys and values you're tracking (not everything in the registry would be needed), do the install/uninstall, then take another snapshot, build a second database, then compare the two databases for the changes.
|
|
|
|
|
AirplanePilot is a struct with some properties, I have the following:
List<airplanepilot> lst;
when I try to change a property(of int type) of one of the list members I get an error:
"cannot modify the return value of because it is not a variable".
I have to mention that when I simply change a property of a struct which is not a member of the list it goes well and I get no errors
|
|
|
|
|
The problem is because you are using a struct, you are modifying a copy of the object you think you are updating. This is because structs are value types rather than reference types, in C# structs are rarely needed. What you have experienced is a common problem that c++ developers hit when making the switch.
The simplest solution is to make AirplanePilot a class as opposed to a struct. It is probably more efficient as well.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
Hi all
i need helping of how the following class do..........
System.Security.Cryptography RNGCryptoServiceProvider
please help me
|
|
|
|
|
The first link from here will help.
RNGCryptoServiceProvider[^]
As will the advice google first, ask second.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
Hi Forum...
I have been looking the page DynamicProperties for PropertyGrid[^] but I have a little problem, this is...
I have a class (myclass), and this class is into a dll (class library . framework 2.0) which I'm creating... and I have the next lines (in general)
using ...
namespace myproject
{
[TypeDescriptionProvider(typeof(DynamicTypeDescriptionProvider))]
public class myclass : otherclass
{
...
}
}
Now the problem is that never enters into the DynamicTypeDescriptor.
Some body can tell me how to fix this problem
How can i include this code into a dll library class?
Thanks for your colaboration
|
|
|
|
|
As I am learning to Custom controls, that article is very intresting. The thing I found out is that if Designer uses custom contro (Dll or in same project) the updated proprties can not be seen as long you don't build your own project or dll to see changes
|
|
|
|
|
I have load dataGridView with following value.
"select customerId,orderId from Order"
now I have load DataGridViewComboBoxColumn with following value
"select customerId, customerName from Customer";
obj.DisplayMember = " customerName ";
obj.ValueMember = " customerId ";
how can I set dataGridView customerName with loaded customerId. dataGridView first column will be DataGridViewComboBoxColumn.
modified on Monday, December 21, 2009 3:53 AM
|
|
|
|
|
Hi guys I would like add a VNC server or REMOTE DESKTOP sharing server (not RDP) in my c# or vb.net Application to provide remote support. Can you tell how can i do it? I've downloaded uvnc server source code (in c++) but i don't know how use it in my c# app.
Please answer me. thank you
|
|
|
|
|
Hi,
In dot net there is option to upgrade your c++ project to C#,vb to vb.net etc.
Have you tried it?
Regards,
Sunil G.
|
|
|
|