0

Hi!

Error - Conversion from string "DataItem.partOne" to type 'Double' is not valid.

I have written the following databinding code in the datagrid and the am getting the above error -

<Columns>
<asp:TemplateColumn HeaderText="Part B" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:checkbox runat="server" ID="partTwo_Edit" checked= '<%# DataBinder.Eval(Container, "DataItem.partTwo") %>' Enabled = '<%# IIf(DataBinder.Eval(Container, "DataItem.partOne" = 0), "False", "True") %>' ></asp:checkbox>
</ItemTemplate>
<ItemStyle HorizontalAlign="Center"></ItemStyle>
</asp:TemplateColumn>
 </Columns>

Help is urgent!

Thanks in advance,
Aditi

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by luckyads
0

I figured it out -

<asp:checkbox runat="server" ID="partTwo_Edit" checked= '<%# DataBinder.Eval(Container, "DataItem.partTwo") %>' Enabled = '<%# IIf(DataBinder.Eval(Container, "DataItem.partOne"), "true", "false") %>' ></asp:checkbox>

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.