Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Protected Sub CheckBoxList1_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBoxList1.DataBound  
    For i As Integer = 0 To CheckBoxList1.Items.Count - 1  
           CheckBoxList1.Items(i).Selected = CType(CheckBoxList1.DataSource, IQueryable(Of Permission)).ToList.Item(i).HasAccess          
	Next  
End Sub
Posted
Updated 31-Jan-11 4:59am
v2
Comments
Sandeep Mewara 31-Jan-11 6:30am    
Any effort?

 
Share this answer
 
Comments
Prerak Patel 31-Jan-11 6:12am    
Same here. I wasted time in translating... I should have checked before posting the answer.
Abhinav S 31-Jan-11 6:36am    
:)
Pravin Patil, Mumbai 31-Jan-11 6:21am    
:D
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]

C#
protected void CheckBoxList1_DataBound(object sender, System.EventArgs e)
{
    for (int i = 0; i <= CheckBoxList1.Items.Count - 1; i++) {
        CheckBoxList1.Items(i).Selected = ((IQueryable<Permission>)CheckBoxList1.DataSource).ToList.Item(i).HasAccess;
    }
}
 
Share this answer
 
Comments
Abhinav S 31-Jan-11 6:37am    
My 5 ;).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900