Click here to Skip to main content
15,904,817 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionASP.net calendar control questions? Pin
pankazmittal22-May-08 5:05
pankazmittal22-May-08 5:05 
AnswerRe: ASP.net calendar control questions? Pin
Laddie22-May-08 18:12
Laddie22-May-08 18:12 
Question[Message Deleted] Pin
Saba0222-May-08 4:26
Saba0222-May-08 4:26 
AnswerRe: How i can Compare date for new releases ? Pin
eyeseetee22-May-08 4:34
eyeseetee22-May-08 4:34 
AnswerRe: How i can Compare date for new releases ? Pin
N a v a n e e t h22-May-08 4:52
N a v a n e e t h22-May-08 4:52 
GeneralRe: How i can Compare date for new releases ? [modified] Pin
Saba0222-May-08 4:59
Saba0222-May-08 4:59 
QuestionCheckBoxList: which checkbox selection unselection triggered my event? Pin
Herman<T>.Instance22-May-08 3:16
Herman<T>.Instance22-May-08 3:16 
AnswerRe: CheckBoxList: which checkbox selection unselection triggered my event? Pin
gnjunge22-May-08 20:46
gnjunge22-May-08 20:46 
I understand your problem.

Since you don't get any information about which of the items was checked/unchecked this won't work.

The best way to do it, is to make one item that does the (un)checking. For example

<asp:CheckBox ID="checkall" runat="server" AutoPostBack="true" Text="(un)check all"
    OnCheckedChanged="checkall_CheckedChanged" />
<asp:CheckBoxList ID="listCheck" runat="server" AutoPostBack="true" OnSelectedIndexChanged="listCheck_SelectedIndexChanged">
    <asp:ListItem Text="Main1"></asp:ListItem>
    <asp:ListItem Text="Main2"></asp:ListItem>
    <asp:ListItem Text="Main3"></asp:ListItem>
    <asp:ListItem Text="Main4"></asp:ListItem>
    <asp:ListItem Text="Main5"></asp:ListItem>
</asp:CheckBoxList>



private bool overrideEvent;
protected void listCheck_SelectedIndexChanged(object sender, EventArgs e)
{
    //we changed something in the list, so if checkall was checked, uncheck it.
    overrideEvent= true;
    checkall.Checked =  false;
}


protected void checkall_CheckedChanged(object sender, EventArgs e)
{
    if (overrideEvent)
        return;

    for (int items = 0; items < listCheck.Items.Count; items++)
        listCheck.Items[items].Selected = checkall.Checked;
}


Notice the use of the boolean, if I manually set the Checked of the checkall item, I don't want the checklist to change, so that's why i use the boolean.
QuestionAccess other pc desk screen by internet Pin
harun622-May-08 2:50
harun622-May-08 2:50 
AnswerRe: Access other pc desk screen by internet Pin
Christian Graus22-May-08 2:51
protectorChristian Graus22-May-08 2:51 
QuestionProblem in binding dataset value with HTML table. Pin
Member 410217122-May-08 2:43
Member 410217122-May-08 2:43 
AnswerRe: Problem in binding dataset value with HTML table. Pin
Christian Graus22-May-08 2:51
protectorChristian Graus22-May-08 2:51 
QuestionConverting winapp to webapp and need to position childcontrols Pin
ErikZ22-May-08 2:30
ErikZ22-May-08 2:30 
QuestionProblem with gridview checkbox [modified] Pin
pinna_hari22-May-08 2:06
pinna_hari22-May-08 2:06 
AnswerRe: Problem with gridview checkbox Pin
NetBot22-May-08 2:35
NetBot22-May-08 2:35 
GeneralRe: Problem with gridview checkbox Pin
pinna_hari22-May-08 19:00
pinna_hari22-May-08 19:00 
GeneralRe: Problem with gridview checkbox Pin
sukkureddy22-May-08 21:14
sukkureddy22-May-08 21:14 
GeneralRe: Problem with gridview checkbox Pin
pinna_hari23-May-08 1:38
pinna_hari23-May-08 1:38 
AnswerRe: Problem with gridview checkbox Pin
eyeseetee22-May-08 3:07
eyeseetee22-May-08 3:07 
QuestionIE6 chopping off page content on Hyperlink first click Pin
markymark8222-May-08 1:34
markymark8222-May-08 1:34 
AnswerRe: IE6 chopping off page content on Hyperlink first click Pin
markymark8222-May-08 4:03
markymark8222-May-08 4:03 
QuestionProblem In IE while Embed .swf file in aspx page Pin
Guvera22-May-08 1:17
Guvera22-May-08 1:17 
QuestionSoftwares for integration of Card swipe machine with .net application Pin
miniThomas22-May-08 1:11
miniThomas22-May-08 1:11 
AnswerRe: Softwares for integration of Card swipe machine with .net application Pin
eyeseetee22-May-08 1:18
eyeseetee22-May-08 1:18 
AnswerRe: Softwares for integration of Card swipe machine with .net application Pin
Christian Graus22-May-08 1:59
protectorChristian Graus22-May-08 1:59 

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.