This is a migrated thread and some comments may be shown as answers.

PushValue error??

5 Answers 63 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Mateo
Top achievements
Rank 1
Mateo asked on 10 Sep 2007, 05:41 PM

one cell is defined as a textbox column bound to an int field.
When i modify the value an error occurs stating that it cannot convert from type string to type int.
Here is how i define the column 

colTxt = new GridViewTextBoxColumn("Age");

colTxt.UniqueName = "Age";

colTxt.IsVisible = true;

colTxt.MaxLength = 3;

colTxt.DataType = typeof(int);

colTxt.AllowResize = false;

colTxt.ReadOnly = false;

this.grdSearchResults.MasterGridViewTemplate.Columns.Add(colTxt);



How can i handle this? Is there an event where i can do the convert myself?
Thanks

5 Answers, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 11 Sep 2007, 03:48 PM
Hello Mateo,

This issues is already fixed and will be available in our Q2 release planed for next week.

Note that when you add a column which is not bound to any data, its values will be processed from the CellFormatting event and it will be unbound.

Thank you for the feedback and sorry for the inconvenience.

 
Best wishes,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Louis
Top achievements
Rank 1
answered on 14 Sep 2007, 12:08 AM
Could it be possible that it is not included in the beta release now available ?
0
Julian Benkov
Telerik team
answered on 14 Sep 2007, 10:42 AM
Indeed, Louis , the fix was added after the Beta release. The good news is that the Q2 release is next week so you would not have to wait much longer to get it.


All the best,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Russell Groover
Top achievements
Rank 1
answered on 21 Mar 2008, 04:01 PM
I'm getting this error with Q3 2007 SP1. 

My column is defined as the following

gridViewTextBoxColumn2.HeaderText =

"Max. Units #";
gridViewTextBoxColumn2.MinWidth = 90;
gridViewTextBoxColumn2.UniqueName =
"maxUnits";
gridViewTextBoxColumn2.DataField =
"MaximumUnits";
gridViewTextBoxColumn2.DataType =
typeof(int);

My datagrid is bound to a BindingList of objects.  The value displays ok but I get the error "System.String cannot be converted to type System.Int32" when I try to edit the cell and move to another cell.

What can I do to allow users to edit numeric values?

0
Julian Benkov
Telerik team
answered on 24 Mar 2008, 12:22 PM
Hello Russell,

This issue is already solved in our Q1 2008 Beta release. I encourage you to download it at this link. Please give us your feedback on whether it meets your needs, and where you would like us to take it for the official release version.

I hope this helps. If you have any other questions, please contact me.

Sincerely yours,
Julian Benkov
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
GridView
Asked by
Mateo
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Louis
Top achievements
Rank 1
Russell Groover
Top achievements
Rank 1
Share this question
or