I have the need to add a phantom "All Selections" item to a databound combo box, but inserting a new item into the data binding source results in source collection also having the "All Selections" item throughout the entire project, which is not desired.
So what's the best practice way of inserting a phantom item into a data bound combo box, so it doesn't mess up the underlying data source?
You can create a class which wraps the actual data source, and exposes an augmented version of the data source with the extra item(s) in the list. Then bind the ComboBox to an instance of the wrapper class.
Im working in an aplication, and i need to show reports from a database in access, those reports must be made using crystal reports, in vs.net. When i make a report with crystal reports, i configure the location of the database, but if i need to move the aplication to another pc, how i can change the location of the database to the report, i need to know if there are something like:
I have textboxes that are Databinding to a DataTable.
I save the values of the textboxes to an Access db.
I have a textbox that is bound with a db column that is a Long Integer.
If I change the number in the textbox to a new number, and update it works ok. If I clear the number in the textbox in the hopes to set the field to DBNull, then the textbox reverts back to the original bound value.
I'm not able to:
if (txb_Number.Text == "")
//this never occurs because the textbox reverts to the original bound Long Integer value
code to update db with a DBNull value
I can only change the bound data if a new number is used. A blank textbox (or letters entered) only reverts back to the origninal value. I want to update the field to DBNull if the textbox is empty.
If you are referring to a Label control you can set its Text property to what ever string you want.
I can I simulate a handdrawing of the letter A, for example, in C#?
You can draw what ever you want also as GDI is wrapped up in the System.Drawing[^] namespace
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871) My: Website | Blog