hi guys, i am working on the deletion of users profile and updation of his status(active or deative). i have done all this in gridview, bt now because of change in functionality i have to do this in listview .
this is my code
protected void GrdJsAllProfileDetail_RowDataBound(object sender, GridViewRowEventArgs e)
{
try
{
DataRowView dRowView = (DataRowView)e.Row.DataItem;
if (e.Row.RowType == DataControlRowType.DataRow)
{
ImageButton imgactivedeactive = (ImageButton)e.Row.FindControl("imgactivedeactive");
imgactivedeactive.CommandName = dRowView["ProfileId"].ToString();
if (dRowView["JSStatus"].ToString() == "True")
{
imgactivedeactive.ImageUrl = "..\\Images\\active.png";
imgactivedeactive.CommandArgument = "False";
}
else
{
imgactivedeactive.ImageUrl = "..\\Images\\deactive.png";
imgactivedeactive.CommandArgument = "True";
}
}
}
catch (Exception ex)
{
}
}
protected void GrdJsAllProfileDetail_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
jsRegister.IntJobseekerid = Convert.ToInt32(Session["JobSeekerId"]);
jsRegister.ProfileId = Convert.ToInt32(e.CommandName);
jsRegister.ISPROFILESTATUS = Convert.ToBoolean(e.CommandArgument);
jsRegister.Update_JobSeeker_Profile_Status();
DisplayAllJobSeekerProfile();
}
catch (Exception ex)
{
}
}
protected void GrdJsAllProfileDetail_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
GridViewRow row = (GridViewRow)GrdJsAllProfileDetail.Rows[e.RowIndex];
ImageButton lndlt = (ImageButton)row.FindControl("imgactivedeactive");
if (lndlt.ImageUrl == "..\\Images\\deactive.png")
{
Label lbldeleteID = (Label)row.FindControl("lblProfileId");
jsRegister.ProfileId = Convert.ToInt32(lbldeleteID.Text);
jsRegister.Delete_JSApplyJob();
jsRegister.Delete_JSProfile();
DisplayAllJobSeekerProfile();
}
else
{
string strjscript = "alert('Sorry, You can't Delete An Active Profile');";
ScriptManager.RegisterStartupScript(this, this.GetType(), "RedirectScript", strjscript, true);
return;
}
}
can you please tell me which events of listview works same like grid views event used in this code .
thanks a lot in advance guys