//Headerkryssruta för gridview gridArtister: public void chkArtvalALLMain_CheckedChanged(GridView gridArtister_Artist, object sender) { foreach (GridViewRow gvRow in gridArtister_Artist.Rows) { DerivCheckBox chksel = (DerivCheckBox)(gvRow.Cells[0].FindControl("chkArtval")); chksel.Checked = ((DerivCheckBox)sender).Checked; if (chksel.Checked == true) { Int32 val = 1; try { db.UpdateRecord_Artist_ChkBox(val); } finally { } } else if (chksel.Checked == false) { Int32 val = 0; try { db.UpdateRecord_Artist_ChkBox(val); } finally { } } } }
//Headerkryssruta för gridview grdResult: public void chkArtvalALLGrdRes_CheckedChanged(GridView grdResult_Artist, object sender) { foreach (GridViewRow gvRow in grdResult_Artist.Rows) { DerivCheckBox chksel = (DerivCheckBox)(gvRow.Cells[0].FindControl("chkArtval")); chksel.Checked = ((DerivCheckBox)sender).Checked; if (chksel.Checked == true) { Int32 val = 1; Int32 row = Int32.Parse(chksel.UnText); try { db.UpdateRecord_Artist_ChkBox(row, val); } finally { } } else if (chksel.Checked == false) { Int32 val = 0; Int32 row = Int32.Parse(chksel.UnText); try { db.UpdateRecord_Artist_ChkBox(row, val); } finally { } } } }
//Kryssruta för gridview gridArtister och grdResult: public void chkArtval_CheckedChanged(GridView gridArtister_Artist, GridView grdResult_Artist) { GridView crossgrid = new GridView(); if (grdResult_Artist.Visible == true) { crossgrid = grdResult_Artist; } else if (gridArtister_Artist.Visible == true) { crossgrid = gridArtister_Artist; } foreach (GridViewRow gvRow in crossgrid.Rows) { DerivCheckBox chksel = (DerivCheckBox)gvRow.FindControl("chkArtval"); if (chksel.Checked == true) { Int32 val = 1; Int32 row = Int32.Parse(chksel.UnText); //Sätter markeringsvärden för markerad rad: gvRow.BackColor = System.Drawing.ColorTranslator.FromHtml("#738A9C"); gvRow.ForeColor = System.Drawing.ColorTranslator.FromHtml("#F7F7F7"); gvRow.Font.Bold = true; try { db.UpdateRecord_Artist_ChkBox(row, val); } finally { } } else if (chksel.Checked == false) { Int32 val = 0; Int32 row = Int32.Parse(chksel.UnText); //Sätter tillbaka markeringsvärden för avmarkerad rad: gvRow.BackColor = System.Drawing.ColorTranslator.FromHtml("#F7F7F7"); gvRow.ForeColor = System.Drawing.ColorTranslator.FromHtml("#4A3C8C"); gvRow.Font.Bold = false; try { db.UpdateRecord_Artist_ChkBox(row, val); } finally { } } } }
//Fungerar som en omstart och rensar alla inmatningsrutor odyl + display: public void button_Refresh_TB(HttpServerUtility server, string retursida) { SetChks_Artist db = new SetChks_Artist(); Int32 val = 0; try { db.UpdateRecord_Artist_ChkBox(val); server.Transfer(retursida); } finally { } }