ASP.NET - Type Convertor - Asked By Shashikala on 10-Nov-11 04:36 AM

Am getting

TypeConverter cannot convert from System.String.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: TypeConverter cannot convert from System.String.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
error while selecting the item from the devexpcombo box in asp.net

how to solve this one
Jitendra Faye replied to Shashikala on 10-Nov-11 04:40 AM
Follow thes links-

http://www.devexpress.com/Support/Center/p/B136601.aspx
http://community.devexpress.com/forums/p/86169/295240.aspx
http://www.devexpress.com/Support/Center/p/Q140379.aspx
Suchit shah replied to Shashikala on 10-Nov-11 04:40 AM
You should write the code by hand to convert string to Size or other structure type. like: New System.Drawing.Size(System.Convert.ToInt32("100"), System.Convert.ToInt32("50"));

To implement a simple type converter that can translate a string to a Point

  1. Define a class that derives from http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter.aspx.

  2. Override the http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter.canconvertfrom.aspx method that specifies which type the converter can convert from. This method is overloaded.

  3. Override the http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter.convertfrom.aspx method that implements the conversion. This method is overloaded.

  4. Override the http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter.canconvertto.aspx method that specifies which type the converter can convert to. It is not necessary to override this method for conversion to a string type. This method is overloaded.

  5. Override the http://msdn.microsoft.com/en-us/library/system.componentmodel.typeconverter.convertto.aspx method that implements the conversion. This method is overloaded.

  6. Override the http://msdn.microsoft.com/en-us/library/5z76f169.aspx method that performs validation. This method is overloaded.

dipa ahuja replied to Shashikala on 10-Nov-11 05:01 AM
Check the same thread:


http://community.devexpress.com/forums/p/86169/295240.aspx
http://www.devexpress.com/Support/Center/p/Q140379.aspx
Kirtan Patel replied to Shashikala on 10-Nov-11 05:09 AM
provide your code so i can tell what is the thing that causes the exception 
kalpana aparnathi replied to Shashikala on 10-Nov-11 01:39 PM
Try this code:

<
system.web>
   <compilation>
   <codeSubDirectories>
     <add directoryName="csFilesdirectory"/>
   </codeSubDirectories>
   </compilation>
 </system.web>
Shashikala replied to kalpana aparnathi on 11-Nov-11 01:10 AM
what is this "csFilesdirectory"  What we need to give for this.  am getting the same error when i click on page index also. how to solve this one
kalpana aparnathi replied to Shashikala on 14-Nov-11 03:45 AM
it is your directory name which you use so please check it first.