FAQ Database Discussion Community


Properly display list of custom objects in Windows Forms' Property Grid

c#,winforms,propertygrid,typeconverter
I'm trying to display the properties of my Wall class in a properties grid. Right now my wall class looks like this: [TypeConverter(typeof(ExpandableObjectConverter))] public class WallType { #region _private variables and Properties public string Name { get; set; } //Name of the wall to identify it. For the wall program,...

Python typecasting string to int fails

python,integer,typeconverter
I get an error when I try to do a simple typecasting from string to integer in python (2.7): year = device.time[year_pos:].strip() # This is '1993' t = int(year) # Throws exception: "UnboundLocalError: local variable 'int' referenced before assignment" Why? :)...

How can I convert byte CP-1252 to byte UTF-8 in java [duplicate]

java,utf-8,converter,typeconverter,cp1252
This question already has an answer here: Encoding cp-1252 as utf-8? 2 answers I have already tried convert byte cp1252 to byte utf8 but all is in vain. For example: I have byte[] 0xB5(cp1252) and I want convert to byte[] 0xC3, 0xA0(utf8). I want to like this: ยต -->...

How can I save values from a textbox (input == text) as Currency values in Sharepoint?

c#,sharepoint-2010,decimal,currency,typeconverter
I have Sharepoint list values that are Currency, such as: list.Fields.Add("Airfare", SPFieldType.Currency, false); But how do I save these values into the list as the Currency type? I tried this: spli["Airfare"] = (SPFieldType.Currency) boxAirfare.Text; ..and this: spli["Airfare"] = boxAirfare.Text as SPFieldType.Currency; ...but they won't compile, telling me, "'Microsoft.SharePoint.SPFieldType.Currency' is a...

How to convert negative byte value to either short or integer?

java,integer,byte,short,typeconverter
We have a file which contains byte array in particular format like header and then followed by data. This file is generated by another java program and then we are reading that same file through another java program in the same format in which it was written. The program which...

How can I convert my string to type for enums?

javascript,enums,typeconverter
For example I have enumtype like: "SampleEnum" SampleEnum: { Day: 0, Week: 1, Month: 2 }, But for one spesific stuff, it comes me as string like "SampleEnum" I have to convert it ------> type directly it should be SampleEnum so I can use Enums.SampleEnum. I need this. How can...

Converting from on type of list to another type

c#,list,typeconverter
I have two classes - Record and RecordModified public class Record { public int RecordID { get; set; } public int FacilityID { get; set; } public int NewAID { get; set; } public string OldID { get; set; } public string Data { get; set; } public int SyncStatusID...

How to force my output data in a inputdlg on Matlab be a double?

matlab,typeconverter
I'm currently using a MATLAB to work and I need some help: I need to convert my output data (variable: units) be a double instead of a cell because I must perform a sum: units = inputdlg(question,title); sum = units + i; I've tried this code also but didn't solve...

Changing custom child property doesn't update parent class's control

.net,vb.net,user-controls,typeconverter
I don't know what I'm doing wrong, but I've created a custom control with a property that features subproperties using a type converter that inherits ExpandableObjectConverter. It seems like I've got everything set up correctly, but when I try to change any of the subproperties of the parent property, the...

Open/Export PDB File

foxpro,visual-foxpro,pdb,typeconverter,pdb-files
I have a working application that is using a PDB file as data source. Due to that application is not doing all what the customer wants, I need to know how I can read/write the information from the PDB file. It doesn't matter if I have to export it to...

TypeConverter with Interfaces

c#,.net,typeconverter
I'm having a little trouble implementing a property in C# as a designer type. Basically I have multiple concrete types that implement an interface. I'd like to select which concrete type at design-time. using System; using System.ComponentModel; using System.Drawing; /// <summary> /// implement a summarizable type /// </summary> public interface...