Click here to Skip to main content
16,008,954 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Javascript Help Pin
Navneet Hegde14-Jan-07 23:14
Navneet Hegde14-Jan-07 23:14 
QuestionSimple database access question Pin
Bulky Fellow14-Jan-07 22:39
Bulky Fellow14-Jan-07 22:39 
AnswerRe: Simple database access question Pin
Colin Angus Mackay14-Jan-07 23:12
Colin Angus Mackay14-Jan-07 23:12 
AnswerRe: Simple database access question Pin
Mark J. Miller15-Jan-07 3:34
Mark J. Miller15-Jan-07 3:34 
Questiondata retrive from database Pin
Pradip Kishore14-Jan-07 22:38
Pradip Kishore14-Jan-07 22:38 
AnswerRe: data retrive from database [modified] Pin
StianSandberg15-Jan-07 1:55
StianSandberg15-Jan-07 1:55 
QuestionGirdView Display Problem Pin
varshavmane14-Jan-07 22:30
varshavmane14-Jan-07 22:30 
AnswerRe: GirdView Display Problem Pin
trish_15-Jan-07 1:34
trish_15-Jan-07 1:34 
Hi,

Try this,
Call procedure CheckBoxListValues() on CheckBoxList's OnDataBinding event to show check/uncheck checkbox

Your aspx code....
Big Grin | :-D
<aspatagrid id="dg" runat="server" AutoGenerateColumns="False">
<COLUMNS>
<asp:templatecolumn HeaderText="Behörighet">
<ITEMTEMPLATE>
<asp:checkboxlist id="Checkboxlist2" runat="server" Width="544px" DataTextField="Name" DataValueField="ValueField"
RepeatDirection="Vertical" OnDataBinding="CheckBoxListValues">
<asp:ListItem Value="Add" Selected="True">Add</asp:ListItem>
<asp:ListItem Value="Modify">Modify</asp:ListItem>
<asp:ListItem Value="Delete">Delete</asp:ListItem>
<asp:ListItem Value="View">View</asp:ListItem>
<asp:ListItem Value="Print">Print</asp:ListItem>
</asp:checkboxlist>
</ITEMTEMPLATE>
</asp:templatecolumn>
</COLUMNS>
/aspatagrid>

and code behind code is ....

Public Sub CheckBoxListValues(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Checkboxlist2.DataBinding
Dim i As Integer
Dim str As String = "AXXVP" 'Pass value from Database


For i = 0 To Checkboxlist2.Items.Count - 1

Select Case i
Case 0 ' Add
If str.Substring(i, 1) = "A" Then
Checkboxlist2.Items(i).Selected = True
Else
Checkboxlist2.Items(i).Selected = False
End If
Case 1 'Modify
If str.Substring(i, 1) = "M" Then
Checkboxlist2.Items(i).Selected = True
Else
Checkboxlist2.Items(i).Selected = False
End If
Case 2 ' Delete
If str.Substring(i, 1) = "D" Then
Checkboxlist2.Items(i).Selected = True
Else
Checkboxlist2.Items(i).Selected = False
End If
Case 3 'View
If str.Substring(i, 1) = "V" Then
Checkboxlist2.Items(i).Selected = True
Else
Checkboxlist2.Items(i).Selected = False
End If
Case 4 ' Print
If str.Substring(i, 1) = "P" Then
Checkboxlist2.Items(i).Selected = True
Else
Checkboxlist2.Items(i).Selected = False
End If
End Select

Next

End Sub


Hope this will help..

Trishul
GeneralRe: GirdView Display Problem Pin
varshavmane15-Jan-07 1:46
varshavmane15-Jan-07 1:46 
QuestionPrevent users from clicking twice on FinishButton (Wizard) Pin
dennizsoftware.se14-Jan-07 22:30
dennizsoftware.se14-Jan-07 22:30 
AnswerRe: Prevent users from clicking twice on FinishButton (Wizard) Pin
just3ala214-Jan-07 22:37
just3ala214-Jan-07 22:37 
GeneralRe: Prevent users from clicking twice on FinishButton (Wizard) Pin
dennizsoftware.se14-Jan-07 23:36
dennizsoftware.se14-Jan-07 23:36 
GeneralRe: Prevent users from clicking twice on FinishButton (Wizard) Pin
just3ala215-Jan-07 0:08
just3ala215-Jan-07 0:08 
QuestionDataset in vb.net Pin
thas02214-Jan-07 21:46
thas02214-Jan-07 21:46 
AnswerRe: Dataset in vb.net Pin
Paddy Boyd14-Jan-07 22:35
Paddy Boyd14-Jan-07 22:35 
GeneralRe: Dataset in vb.net Pin
thas02215-Jan-07 0:41
thas02215-Jan-07 0:41 
Questionwebsite page display Pin
vengaqua14-Jan-07 21:07
vengaqua14-Jan-07 21:07 
AnswerRe: website page display Pin
StianSandberg14-Jan-07 21:42
StianSandberg14-Jan-07 21:42 
QuestionUrgent!!! Validationcontrols not working Pin
Ramya SM14-Jan-07 20:11
Ramya SM14-Jan-07 20:11 
QuestionASP software security Pin
Haun the 2nd14-Jan-07 12:37
Haun the 2nd14-Jan-07 12:37 
AnswerRe: ASP software security Pin
Guffa14-Jan-07 13:04
Guffa14-Jan-07 13:04 
GeneralRe: ASP software security Pin
Haun the 2nd14-Jan-07 14:06
Haun the 2nd14-Jan-07 14:06 
AnswerRe: ASP software security Pin
Christian Graus14-Jan-07 16:05
protectorChristian Graus14-Jan-07 16:05 
AnswerRe: ASP software security Pin
Vasudevan Deepak Kumar14-Jan-07 17:04
Vasudevan Deepak Kumar14-Jan-07 17:04 
QuestionCreating a Web Interface in ASP.NET using C# Pin
koonda00714-Jan-07 9:33
koonda00714-Jan-07 9:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.