Click here to Skip to main content
15,890,512 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 19:33
CommDev25-Dec-12 19:33 
AnswerRe: why should I care about ExecuteScalar Pin
CommDev25-Dec-12 19:40
CommDev25-Dec-12 19:40 
GeneralRe: why should I care about ExecuteScalar Pin
Jassim Rahma28-Dec-12 9:40
Jassim Rahma28-Dec-12 9:40 
GeneralRe: why should I care about ExecuteScalar Pin
Naveen Katta26-Dec-12 0:10
Naveen Katta26-Dec-12 0:10 
Questiona control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)23-Dec-12 23:01
professionalAli Al Omairi(Abu AlHassan)23-Dec-12 23:01 
QuestionRe: a control that should contain html elements Pin
jkirkerx24-Dec-12 13:09
professionaljkirkerx24-Dec-12 13:09 
AnswerRe: a control that should contain html elements Pin
Ali Al Omairi(Abu AlHassan)25-Dec-12 19:51
professionalAli Al Omairi(Abu AlHassan)25-Dec-12 19:51 
Questioncheckedchange event of gridview in javascript Pin
Ravi_kant23-Dec-12 19:29
Ravi_kant23-Dec-12 19:29 
Hi All
i have a gridview

XML
<asp:GridView ID="GridView2" runat="server" Width="100%"
            AutoGenerateColumns="False">
            <Columns>
                <asp:BoundField DataField="description" HeaderText="Description" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:BoundField>
                <asp:BoundField DataField="Amount" HeaderText="Amount" >
                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Month">
                    <ItemTemplate>
                        <asp:CheckBox ID="CheckBoxJan" runat="server" Text="Jan" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxFeb" runat="server" Text="Feb" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxMar" runat="server" Text="Mar" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxApr" runat="server" Text="Apr" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxMay" runat="server" Text="May" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxJun" runat="server" Text="Jun" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxJul" runat="server" Text="Jul" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxAug" runat="server" Text="Aug" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxSep" runat="server" Text="Sep" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxOct" runat="server" Text="Oct" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxNov" runat="server" Text="Nov" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:CheckBox ID="CheckBoxDec" runat="server" Text="Dec" AutoPostBack="True"
                            oncheckedchanged="CheckBoxJan_CheckedChanged" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

and i am using checked change event for checkbox as
protected void CheckBoxJan_CheckedChanged(object sender, EventArgs e)
{
    string desc = "";
    Double amount = 0;
    for (Int32 i = 0; i < GridView2.Rows.Count; i++)
    {
        double amt = 0;
        CheckBox checkBox1 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxJan");
        bool isChecked1 = checkBox1.Checked;
        CheckBox checkBox2 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxFeb");
        bool isChecked2 = checkBox2.Checked;
        CheckBox checkBox3 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxMar");
        bool isChecked3 = checkBox3.Checked;
        CheckBox checkBox4 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxApr");
        bool isChecked4 = checkBox4.Checked;
        CheckBox checkBox5 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxMay");
        bool isChecked5 = checkBox5.Checked;
        CheckBox checkBox6 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxJun");
        bool isChecked6 = checkBox6.Checked;
        CheckBox checkBox7 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxJul");
        bool isChecked7 = checkBox7.Checked;
        CheckBox checkBox8 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxAug");
        CheckBox checkBox9 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxSep");
        bool isChecked8 = checkBox8.Checked;
        CheckBox checkBox10 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxOct");
        bool isChecked9 = checkBox9.Checked;
        CheckBox checkBox11 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxNov");
        CheckBox checkBox12 = (CheckBox)GridView2.Rows[i].Cells[2].FindControl("CheckBoxDec");
        bool isChecked10 = checkBox10.Checked;
        bool isChecked11 = checkBox11.Checked;
        bool isChecked12 = checkBox12.Checked;
        if (isChecked1 && checkBox1.Enabled==true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Jan" + ",";
        }
        if (isChecked2 && checkBox2.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Feb" + ",";
        }
        if (isChecked3 && checkBox3.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Mar" + ",";
        }
        if (isChecked4 && checkBox4.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Apr" + ",";
        }
        if (isChecked5 && checkBox5.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "May" + ",";
        }
        if (isChecked6 && checkBox6.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Jun" + ",";
        }
        if (isChecked7 && checkBox7.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Jul" + ",";
        }
        if (isChecked8 && checkBox8.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Aug" + ",";
        }
        if (isChecked9 && checkBox9.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Sep" + ",";
        }
        if (isChecked10 && checkBox10.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Oct" + ",";
        }
        if (isChecked11 && checkBox11.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Nov" + ",";
        }
        if (isChecked12 && checkBox12.Enabled == true)
        {
            amt = Convert.ToDouble(GridView2.Rows[i].Cells[1].Text);
            amount = amount + amt;
            desc = desc + "Dec" + ",";
        }
    }
    Label24.Text = amount.ToString();
    Label17.Text = (Convert.ToDouble(Label23.Text) + Convert.ToDouble(Label24.Text) + Convert.ToDouble(Label27.Text)).ToString();
    Label29.Text = desc;
}

so here after every checked change page is getting reloaded but i want to do this in javascript(client side)

so please help me to do this

regards
Ravi kant
AnswerRe: checkedchange event of gridview in javascript Pin
Sampath Kumar Sathiya24-Dec-12 0:20
Sampath Kumar Sathiya24-Dec-12 0:20 
GeneralRe: checkedchange event of gridview in javascript Pin
Ravi_kant24-Dec-12 7:40
Ravi_kant24-Dec-12 7:40 
Questionupdated data from gridview Pin
Member 970720723-Dec-12 0:30
Member 970720723-Dec-12 0:30 
AnswerRe: updated data from gridview Pin
Ali Al Omairi(Abu AlHassan)24-Dec-12 4:31
professionalAli Al Omairi(Abu AlHassan)24-Dec-12 4:31 
AnswerRe: updated data from gridview Pin
Sandeep Mewara25-Dec-12 19:35
mveSandeep Mewara25-Dec-12 19:35 
Question.net question Pin
Tarani Dutt Joshi21-Dec-12 23:53
Tarani Dutt Joshi21-Dec-12 23:53 
AnswerRe: .net question Pin
Richard MacCutchan22-Dec-12 0:18
mveRichard MacCutchan22-Dec-12 0:18 
AnswerRe: .net question Pin
MaulikDusara24-Dec-12 21:38
MaulikDusara24-Dec-12 21:38 
AnswerRe: .net question Pin
Sandeep Mewara25-Dec-12 19:33
mveSandeep Mewara25-Dec-12 19:33 
QuestionWebRequest Pin
cdpsource21-Dec-12 14:16
cdpsource21-Dec-12 14:16 
Questionwebpage has resulted in too many redirects Pin
Jassim Rahma21-Dec-12 9:46
Jassim Rahma21-Dec-12 9:46 
AnswerRe: webpage has resulted in too many redirects Pin
jkirkerx22-Dec-12 18:50
professionaljkirkerx22-Dec-12 18:50 
GeneralRe: webpage has resulted in too many redirects Pin
Jassim Rahma23-Dec-12 8:36
Jassim Rahma23-Dec-12 8:36 
GeneralRe: webpage has resulted in too many redirects Pin
jkirkerx23-Dec-12 8:47
professionaljkirkerx23-Dec-12 8:47 
GeneralRe: webpage has resulted in too many redirects Pin
Jassim Rahma24-Dec-12 9:10
Jassim Rahma24-Dec-12 9:10 
GeneralRe: webpage has resulted in too many redirects Pin
jkirkerx24-Dec-12 13:05
professionaljkirkerx24-Dec-12 13:05 
Questionpop up on mouse over on a image button Pin
Yasir88721-Dec-12 6:42
Yasir88721-Dec-12 6:42 

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.