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
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
All the best,
Julian Benkov
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
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?
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