Hello
Jeremy,
DataBinder.Eval and
Eval are essentially the same in your example.
The difference will come when you have many nested controls once inside another. And from the inner most you want to
Eval field from the outermost.
Then you can use DataBinder.Eval(Container.Parent.Parent.Parent.... Parent.DataItem , "some field");
DataType will affect the way values are passed in the where clause of the filter expressions
Select Something from.. ..where 'SomeField' < "123,56"
Select Something from.. ..where 'SomeField' < 123.56
Depending on the datasource it will have different effects as:
*Sorting columns as string, instead of as numbers:
*Passing wrong decimal separator.
*Some datasource will throw exception that the data is not in correct format.
*aggregates will not work.
*filter item of the grid will have wrong values: "Contains" , "StartsWith", these are practically not suitable for numbers.
It is recommended to always set the correct
DataType to avoid all issues described above.
In the EditItemTemplate you need to use the Bind expression
Also note that it is recommended to use the DbValue instead of just Value property. Because the DbValue of RadNumericTextBox cast the value to the correct type before inserting.
Regards,
Vasil
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the
Telerik API Analyzer and share your thoughts.