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

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>

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.