Hey Guys,
I am using a custom user control to Edit/Insert records, but when I click the Add New record button I am getting an error when the RadNumericTextBox is about to be bind, I think its because the '<%# DataBinder.Eval( Container, "DataItem.CommissionRate") %>' is null as I am adding a new record, I have been trying to find away around this with no results.
Here is the html for the user control:
<telerik:RadNumericTextBox ID="TxCommissionRate" runat="server" EmptyMessage="Enter Comission Rate" MinValue="1.00" MaxValue="99999.99" Skin="Forest" Width="94px" Value='<%# DataBinder.Eval( Container, "DataItem.CommissionRate") %>' > </telerik:RadNumericTextBox>
As I said I get no error if I am editing a record, but when I click the add record button I get an error saying: System.InvalidCastException was unhandled by user code
Message="Specified cast is not valid."
Source="App_Web_bc5zubk-"
StackTrace:
at ASP.BillerInfo.__DataBindingTxCommissionRate(Object sender, EventArgs e) in c:\Documents and Settings\NWilliams\My Documents\Visual Studio 2005\WebSites\WebExpress\Admin\Biller\BillerInfo.ascx:line 105
at System.Web.UI.Control.OnDataBinding(EventArgs e)
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBind()
at System.Web.UI.Control.DataBindChildren()
Any help will be greatly appreciated.
Regards,
Nyron.
I am using a custom user control to Edit/Insert records, but when I click the Add New record button I am getting an error when the RadNumericTextBox is about to be bind, I think its because the '<%# DataBinder.Eval( Container, "DataItem.CommissionRate") %>' is null as I am adding a new record, I have been trying to find away around this with no results.
Here is the html for the user control:
<telerik:RadNumericTextBox ID="TxCommissionRate" runat="server" EmptyMessage="Enter Comission Rate" MinValue="1.00" MaxValue="99999.99" Skin="Forest" Width="94px" Value='<%# DataBinder.Eval( Container, "DataItem.CommissionRate") %>' > </telerik:RadNumericTextBox>
As I said I get no error if I am editing a record, but when I click the add record button I get an error saying: System.InvalidCastException was unhandled by user code
Message="Specified cast is not valid."
Source="App_Web_bc5zubk-"
StackTrace:
at ASP.BillerInfo.__DataBindingTxCommissionRate(Object sender, EventArgs e) in c:\Documents and Settings\NWilliams\My Documents\Visual Studio 2005\WebSites\WebExpress\Admin\Biller\BillerInfo.ascx:line 105
at System.Web.UI.Control.OnDataBinding(EventArgs e)
at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
at System.Web.UI.Control.DataBind()
at System.Web.UI.Control.DataBindChildren()
Any help will be greatly appreciated.
Regards,
Nyron.