Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datalist with Checkbox selection

Status
Not open for further replies.

Out2work

Technical User
Oct 7, 2009
12
GB
Hi,
I have a datalist control and inside i have placed a checkbox control now what i need is to be able to check multiple items and the selected items border change to say green or unselect they remain grey.
I am using ajax if its any help.

can anyone provide some suggestions on how to achieve this as im having issues with the changing of borders.
 
You can set the color property of the row (or div) using a function that you call with the current rows value...

E.G. In code behind something likke (and this is vb code...so if you are c# just convert it..)

function [red]SetColor[/red](value as boolean) as string
if value=1 then
return " style='color:blue'"
else
return " style='color:red'"
end if
end function

and in your dataview

<div <%[red]SetColor[/red](eval("BooleanColumn")%>other html</div>

the result would look somehting like

<div style='color:blue'>other html</div>
or rendered
[blue]other html[/blue]

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top