<%@ Page Language="C#" MasterPageFile="~/MasterPage/Admin.master" AutoEventWireup="true" CodeFile="UpdateTask.aspx.cs" Inherits="AdminModule_Default" Title="Untitled Page" %>
code
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class AdminModule_Default : System.Web.UI.Page
{
REMO obj = new REMO();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
clnt();
// details();
MultiView1.Visible = true;
MultiView1.SetActiveView(View1);
}
}
private void clnt()
{
ListItem li = new ListItem();
string qr = "select ProjectTitle from ClientDetails";
DataSet ds = new DataSet();
ds = obj.GETDS(qr);
DropDownList1.DataSource = ds.Tables[0];
DropDownList1.DataValueField = ds.Tables[0].Columns["ProjectTitle"].ToString();
DropDownList1.DataBind();
li.Text = "Choose";
DropDownList1.Items.Insert(0, li);
}
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
details();
}
private void details()
{
try
{
string qre = "select Modules,Task from ClientDetails where ProjectTitle ='" + DropDownList1.SelectedItem.ToString() + "'";
DataSet ds = new DataSet();
ds = obj.GETDS(qre);
if (ds.Tables[0].Rows.Count != 0)
{
GridView1.DataSource = ds;
GridView1.DataBind();
}
else if (ds.Tables[0].Rows.Count == 0)
{
lbgrdvs.Text = "There is No Module in the List";
}
else
{
lbgrdvs.Text = "There is No Module in the List";
}
}
catch (Exception e)
{
throw e;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string qre = "select Modules,Task from ClientDetails where ProjectTitle ='" + DropDownList1.SelectedItem.ToString() + "' and Statuss != 'Completed'";
DataSet dds = new DataSet();
dds = obj.GETDS(qre);
lbgrdvs.Text="k";
}
protected void GridView1_RowUpdating1(object sender, GridViewUpdateEventArgs e)
{
GridViewRow grds = GridView1.Rows[e.RowIndex];
TextBox tmle = (TextBox)grds.FindControl("ttmle");
TextBox taskg = (TextBox)grds.FindControl("txttsk");
// Label lb = ((Label)grds.FindControl("lblmdule"));
DropDownList ddl = ((DropDownList)grds.FindControl("DropDownList1"));
string qer = " update ClientDetails set Modules='" + tmle.Text;
qer += "',Task='" + taskg.Text;
// qer += "',Statuss='Complete';
qer += "' where ProjectTitle='" + DropDownList1.SelectedItem.ToString();
qer += "'";
obj.Insert(qer);
GridView1.EditIndex = -1;
details();
}
protected void GridView1_RowEditing1(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
details();
}
protected void GridView1_RowCommand1(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
string temp = Convert.ToString(e.CommandArgument);
}
}
}

Replies
Know the answer? Post it — somebody with the same question will find it here.