Click here to Skip to main content
15,909,030 members
Home / Discussions / ASP.NET
   

ASP.NET

 
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 
GeneralRe: Editable Grid view Pin
sarthakm29-Oct-13 5:28
sarthakm29-Oct-13 5:28 
public partial class _Default : System.Web.UI.Page
{
StringBuilder StrBuilder;
ClsHBC_Bl ObjHbcBL;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{

ObjHbcBL = new ClsHBC_Bl();
DataTable dt = new DataTable();
dt = ObjHbcBL.GetEmployees_BL();
ViewState["dt"] = dt;
grdEmployees.DataSource = dt;
grdEmployees.DataBind();
}


}
protected void BindGrid()
{
grdEmployees.DataSource =(DataTable) ViewState["dt"] ;
grdEmployees.DataBind();
}



protected void BtnDelete_Click(object sender, EventArgs e)
{
GridViewRow gvRow = (GridViewRow)(sender as Control).Parent.Parent;
Label1.Text = "hi";
}


protected void grdEmployees_RowCommand(object sender, GridViewCommandEventArgs e)
{







}

protected void grdEmployees_SelectedIndexChanged(object sender, EventArgs e)
{

}

protected void Button_click_event(Object sender, EventArgs e)
{
Label1.Text = "Hello";
}







protected void grdEmployees_RowDataBound(object sender, GridViewRowEventArgs e)
{


}

protected void grdEmployees_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int cEmployeeID = (int)grdEmployees.DataKeys[e.RowIndex].Value;
ObjHbcBL.DeleteEmployee_BL(cEmployeeID);

}

protected void btnUpdate_Click(object sender, EventArgs e)
{
StrBuilder = new StringBuilder(string.Empty);
StringWriter stringWriter = new StringWriter(StrBuilder);

CheckBox CC;

DataSet ds = new DataSet();
DataTable dt = new DataTable("toUpdate");
dt.Columns.Add("EmpId", typeof(int));
dt.Columns.Add("ContactNo", typeof(String));
dt.Columns.Add("Experience", typeof(String));
dt.Columns.Add("Skill", typeof(String));
ds.Tables.Add(dt);

for (byte i = 0; i <= grdEmployees.Rows.Count-1; i++)
{
CC = (CheckBox)grdEmployees.Rows[i].FindControl("chkBxSelect");

if (CC.Checked)
{
DataRow r;
r = ds.Tables["toUpdate"].NewRow();

r["EmpId"] = int.Parse((grdEmployees.Rows[i].Cells[1].FindControl("lblEmpId") as Label).Text);
r["ContactNo"] = (grdEmployees.Rows[i].Cells[5].FindControl("txtContactNo") as TextBox).Text;
r["Experience"] = int.Parse((grdEmployees.Rows[i].Cells[6].FindControl("txtExp") as TextBox).Text);
r["Skill"] = (grdEmployees.Rows[i].Cells[7].FindControl("txtSkill") as TextBox).Text;
ds.Tables["toUpdate"].Rows.Add(r);
}
DataTable dtnew = ds.Tables["toUpdate"];
dtnew.WriteXml(stringWriter, XmlWriteMode.IgnoreSchema);
StrBuilder.Append(stringWriter);



}







}


}
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 
Questionauthentication in vb.net with asp.net Pin
Sonia Gupta1-Jul-07 18:57
Sonia Gupta1-Jul-07 18:57 

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.