Click here to Skip to main content
       

ASP.NET

 
AnswerRe: why should I care about ExecuteScalar PinmemberCommDev25-Dec-12 19:33 
AnswerRe: why should I care about ExecuteScalar PinmemberCommDev25-Dec-12 19:40 
GeneralRe: why should I care about ExecuteScalar PinmemberJassim Rahma28-Dec-12 9:40 
GeneralRe: why should I care about ExecuteScalar PinmemberNaveen Katta26-Dec-12 0:10 
Questiona control that should contain html elements [modified] PinmemberAli Al Omairi(Abu AlHassan)23-Dec-12 23:01 
QuestionRe: a control that should contain html elements Pinmemberjkirkerx24-Dec-12 13:09 
AnswerRe: a control that should contain html elements PinmemberAli Al Omairi(Abu AlHassan)25-Dec-12 19:51 
Questioncheckedchange event of gridview in javascript PinmemberRavi_kant23-Dec-12 19:29 
Hi All
i have a gridview
 
<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 PinmemberSampath Kumar Sathiya24-Dec-12 0:20 
GeneralRe: checkedchange event of gridview in javascript PinmemberRavi_kant24-Dec-12 7:40 
Questionupdated data from gridview PinmemberMember 970720723-Dec-12 0:30 
AnswerRe: updated data from gridview PinmemberAli Al Omairi(Abu AlHassan)24-Dec-12 4:31 
AnswerRe: updated data from gridview PinmvpSandeep Mewara25-Dec-12 19:35 
Question.net question PinmemberTarani Dutt Joshi21-Dec-12 23:53 
AnswerRe: .net question PinmvpRichard MacCutchan22-Dec-12 0:18 
AnswerRe: .net question PinmemberMaulikDusara24-Dec-12 21:38 
AnswerRe: .net question PinmvpSandeep Mewara25-Dec-12 19:33 
QuestionWebRequest Pinmembercdpsource21-Dec-12 14:16 
Questionwebpage has resulted in too many redirects PinmemberJassim Rahma21-Dec-12 9:46 
AnswerRe: webpage has resulted in too many redirects Pinmemberjkirkerx22-Dec-12 18:50 
GeneralRe: webpage has resulted in too many redirects PinmemberJassim Rahma23-Dec-12 8:36 
GeneralRe: webpage has resulted in too many redirects Pinmemberjkirkerx23-Dec-12 8:47 
GeneralRe: webpage has resulted in too many redirects PinmemberJassim Rahma24-Dec-12 9:10 
GeneralRe: webpage has resulted in too many redirects Pinmemberjkirkerx24-Dec-12 13:05 
Questionpop up on mouse over on a image button PinmemberYasir88721-Dec-12 6:42 

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

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


Advertise | Privacy | Mobile
Web04 | 2.8.140827.1 | Last Updated 29 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid