Hi
I am having a struggle getting this to work...
A grid item looks like this:
and I am trying to set values from code behind in the item databound event:
I am getting run time errors such as can't convert string "" to decimal. I have tried a number of variations but it seems I am not getting the column value.
Can you put me right?
Thanks
Clive
I am having a struggle getting this to work...
A grid item looks like this:
<telerik:GridTemplateColumn DataField="PricePerBottle" |
DataType="System.Decimal" HeaderText="£/Unit" SortExpression="PricePerBottle" |
UniqueName="PricePerBottle"> |
<ItemTemplate> |
<asp:Label ID="PricePerBottleLabel" runat="server" Text=''></asp:Label> |
</ItemTemplate> |
Protected Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemDataBound |
If TypeOf e.Item Is GridDataItem Then |
Dim label1 As Label = DirectCast(item("PricePerBottle").FindControl("PricePerBottleLabel"), Label) |
label1.Text = someMathFunction(item("PricePerBottle").Text) |
I am getting run time errors such as can't convert string "" to decimal. I have tried a number of variations but it seems I am not getting the column value.
Can you put me right?
Thanks
Clive