DataBound Checkbox aaaaargh!!!!

S

Stefan

Hey folks,
I am stumped on this one any help would be greatly appreciated... I have
probabley tried every article on google....

Error
System.InvalidCastException: Specified cast is not valid.


Checked = '<%# DataBinder.Eval(Container.DataItem,"bInactive")%>'>


The value returned is either a 0 or a 1
 
B

Bharat Biyani

Hi Stefan,

Do this,
Checked = '<%#
Sysyem.ConvertToBoolean(DataBinder.Eval(Container.DataItem,"bInactive"))%>'>
 
S

Stefan

Thanks Bharat ... That did it ... :)

Bharat Biyani said:
Hi Stefan,

Do this,
Checked = '<%#
Sysyem.ConvertToBoolean(DataBinder.Eval(Container.DataItem,"bInactive"))%>'>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,819
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top