Click here to Skip to main content
16,005,734 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how to assign values in datatable? Pin
honeyss1-Jul-07 20:15
honeyss1-Jul-07 20:15 
GeneralRe: how to assign values in datatable? Pin
moomoooomoo1-Jul-07 21:06
moomoooomoo1-Jul-07 21:06 
GeneralRe: how to assign values in datatable? Pin
honeyss1-Jul-07 21:12
honeyss1-Jul-07 21:12 
QuestionEditable Grid view Pin
hari4ur1-Jul-07 19:52
hari4ur1-Jul-07 19:52 
AnswerRe: Editable Grid view Pin
Sathesh Sakthivel1-Jul-07 19:55
Sathesh Sakthivel1-Jul-07 19:55 
GeneralRe: Editable Grid view Pin
hari4ur2-Jul-07 20:15
hari4ur2-Jul-07 20:15 
AnswerRe: Editable Grid view Pin
sarthakm17-Sep-13 9:53
sarthakm17-Sep-13 9:53 
GeneralRe: Editable Grid view Pin
sarthakm29-Oct-13 5:26
sarthakm29-Oct-13 5:26 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="assignment._Default" %>


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript">
var TotalChkBx;
var Counter;

window.onload = function () {

TotalChkBx = parseInt('<%= this.grdEmployees.Rows.Count %>');

Counter = 0;
}

function HeaderClick(CheckBox) {
var TargetBaseControl =
document.getElementById('<%= this.grdEmployees.ClientID %>');
var TargetChildControl = "chkBxSelect";
var Inputs = TargetBaseControl.getElementsByTagName("input");

for (var n = 0; n < Inputs.length; ++n)
if (Inputs[n].type == 'checkbox' &&
Inputs[n].id.indexOf(TargetChildControl, 0) >= 0)
Inputs[n].checked = CheckBox.checked;

//Reset Counter
Counter = CheckBox.checked ? TotalChkBx : 0;
}

function ChildClick(CheckBox, HCheckBox) {
//get target control.
var HeaderCheckBox = document.getElementById(HCheckBox);

//Modifiy Counter;
if (CheckBox.checked && Counter < TotalChkBx)
Counter++;
else if (Counter > 0)
Counter--;

//Change state of the header CheckBox.
if (Counter < TotalChkBx)
HeaderCheckBox.checked = false;
else if (Counter == TotalChkBx)
HeaderCheckBox.checked = true;
}

function isDelete() {
return confirm("Do you want to delete this row ?");
}

</script>
</head>
<body>
<form id="form1" runat="server">





















<%--for grid--%>
<%-- <asp:boundfield headertext="Price" datafield="price" itemstyle-horizontalalign="Center" headerstyle-width="20" footertext="Total Price:">
<asp:boundfield headertext="total" datafield="total" itemstyle-horizontalalign="left" headerstyle-width="50" }"="">--%><%-- <asp:boundfield headertext="Price" datafield="price" itemstyle-horizontalalign="Center" headerstyle-width="20" footertext="Total Price:">
<asp:boundfield headertext="total" datafield="total" itemstyle-horizontalalign="left" headerstyle-width="50" }"="">--%><%-- <asp:boundfield headertext="Price" datafield="price" itemstyle-horizontalalign="Center" headerstyle-width="20" footertext="Total Price:">
<asp:boundfield headertext="total" datafield="total" itemstyle-horizontalalign="left" headerstyle-width="50" }"="">--%>
<%--for grid--%>
<%--last--%>
<asp:gridview id="grdEmployees" runat="server" autogeneratecolumns="false" width="1112px"
="" headerstyle-backcolor="#CCCCCC" showfooter="true" allowpaging="true" pagesize="5" onrowcommand="grdEmployees_RowCommand" onselectedindexchanged="grdEmployees_SelectedIndexChanged" onrowdatabound="grdEmployees_RowDataBound" onrowdeleting="grdEmployees_RowDeleting">
<columns>
<asp:templatefield headertext="Select">
<itemtemplate>
<asp:checkbox id="chkBxSelect" runat="server">

<HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
<itemstyle horizontalalign="Center" verticalalign="Middle" width="50px">
<HeaderTemplate>
<asp:checkbox id="chkBxHeader" onclick="javascript:HeaderClick(this);" runat="server">
</HeaderTemplate>

<asp:templatefield headertext="Employee Id" itemstyle-horizontalalign="Center" headerstyle-width="40">
<itemtemplate>
<asp:label id="lblEmpId" runat="server" text="<%#Eval("EmpId") %>">

<HeaderStyle Width="40px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<asp:templatefield headertext="Name" itemstyle-horizontalalign="Center" headerstyle-width="40">
<itemtemplate>
<asp:label id="lblEmpName" runat="server" text="<%#Eval("EmpName") %>">

<HeaderStyle Width="40px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<asp:boundfield headertext="Account" datafield="Account" itemstyle-horizontalalign="Center"
="" headerstyle-width="20">
<HeaderStyle Width="20px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<asp:boundfield headertext="Email" datafield="email" itemstyle-horizontalalign="Center"
="" headerstyle-width="20">
<HeaderStyle Width="20px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<asp:templatefield headertext="Contact No" itemstyle-horizontalalign="Center" headerstyle-width="50">
<itemtemplate>
<asp:textbox id="txtContactNo" runat="server" text="<%#Eval("ContactNo") %>">

<HeaderStyle Width="50px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<asp:templatefield headertext="Experience" itemstyle-horizontalalign="Center" headerstyle-width="10">
<itemtemplate>
<asp:textbox id="txtExp" runat="server" text="<%#Eval("Experience") %>">

<HeaderStyle Width="10px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<asp:templatefield headertext="Skill" itemstyle-horizontalalign="Center" headerstyle-width="20">
<itemtemplate>
<asp:textbox id="txtSkill" runat="server" text="<%#Eval("Skill") %>">

<HeaderStyle Width="20px"></HeaderStyle>
<itemstyle horizontalalign="Center">

<%-- Adding button to gridview --%>
<asp:templatefield headertext="Delete">
<itemtemplate>
<asp:button id="BtnDelete" commandname="dele" runat="server" text="Delete" commandargument="<%# Eval("EmpId") %>" oonclientclick="isDelete()"
="" onclick="BtnDelete_Click">


<%-- <asp:boundfield headertext="Price" datafield="price" itemstyle-horizontalalign="Center" headerstyle-width="20" footertext="Total Price:">
<asp:boundfield headertext="total" datafield="total" itemstyle-horizontalalign="left" headerstyle-width="50" }"="">--%>

<HeaderStyle BackColor="#CC99FF"></HeaderStyle>


 
 


<asp:button id="btnUpdate" runat="server" onclick="btnUpdate_Click" text="Update">
<asp:label id="Label1" runat="server" text="Label">
 


</form>
</body>
</html>
GeneralRe: Editable Grid view Pin
sarthakm29-Oct-13 5:28
sarthakm29-Oct-13 5:28 
AnswerRe: Editable Grid view Pin
Venkatesh Mookkan1-Jul-07 19:56
Venkatesh Mookkan1-Jul-07 19:56 
QuestionExpression Validator Pin
rzthebeginner1-Jul-07 19:49
rzthebeginner1-Jul-07 19:49 
AnswerRe: Expression Validator Pin
Sathesh Sakthivel1-Jul-07 19:53
Sathesh Sakthivel1-Jul-07 19:53 
QuestionProblems with Visual.NET Pin
anystudent1-Jul-07 19:32
anystudent1-Jul-07 19:32 
AnswerRe: Problems with Visual.NET Pin
Venkatesh Mookkan1-Jul-07 19:58
Venkatesh Mookkan1-Jul-07 19:58 
QuestionLookup Pin
kvijayajyothy1-Jul-07 19:30
kvijayajyothy1-Jul-07 19:30 
QuestionEdit Session Time Out In ASP.net 2.0 Pin
HatakeKaKaShi1-Jul-07 19:19
HatakeKaKaShi1-Jul-07 19:19 
AnswerRe: Edit Session Time Out In ASP.net 2.0 Pin
Venkatesh Mookkan1-Jul-07 20:00
Venkatesh Mookkan1-Jul-07 20:00 
AnswerRe: Edit Session Time Out In ASP.net 2.0 Pin
Urs Enzler1-Jul-07 20:49
Urs Enzler1-Jul-07 20:49 
Questionmessagebox in vb.net with asp.net Pin
Sonia Gupta1-Jul-07 19:07
Sonia Gupta1-Jul-07 19:07 
AnswerRe: messagebox in vb.net with asp.net Pin
Venkatesh Mookkan1-Jul-07 20:04
Venkatesh Mookkan1-Jul-07 20:04 
GeneralRe: messagebox in vb.net with asp.net Pin
Sonia Gupta1-Jul-07 20:13
Sonia Gupta1-Jul-07 20:13 
GeneralRe: messagebox in vb.net with asp.net Pin
Venkatesh Mookkan1-Jul-07 20:22
Venkatesh Mookkan1-Jul-07 20:22 
QuestionGetting Session idleness time Pin
raju12481-Jul-07 19:03
raju12481-Jul-07 19:03 
AnswerRe: Getting Session idleness time Pin
Sonia Gupta1-Jul-07 19:14
Sonia Gupta1-Jul-07 19:14 
GeneralRe: Getting Session idleness time Pin
raju12481-Jul-07 20:21
raju12481-Jul-07 20:21 

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.