3
Answers

How to bind/fetch column value(HoardingId) in alert message

Abhimanyu Singh

Abhimanyu Singh

11y
1.3k
1
Hii all here,

Please help me in binding/showing the deleted Hoarding ID with Alert message...Below are the code that is deleted the data but i want deleted id should show in alert message.

Please help..

if (e.CommandName == "delete")
                {
                    int rowId = Convert.ToInt32(e.CommandArgument.ToString());
                    Label lblHoardingId = gvPostedHoarding.Rows[rowId].FindControl("lblHoardingId") as Label;
                    HId = Convert.ToInt32(lblHoardingId.Text.Trim());
                    lblMsg.Text = objHoarding.HoardingDetailsDelete("delete", HId);
                        //Session["HoId"] = lblHoardingId.Text;
                    HoardingDetailsOwner();
                         //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Hoarding ID' '" + Session["HoId"].ToString() + "' 'deleted succesfully.');", true);
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Hoarding ID  + HId + deleted succesfully.');", true);
                }


Answers (3)
0
Akkiraju Ivaturi

Akkiraju Ivaturi

NA 9.5k 2.5m 12y
dataGridView1.Rows[dataGridView1.Rows.Count - 1].Selected = true;

or

dataGridView1.Rows[Rowindex].Selected = true;
0
Sukesh Marla

Sukesh Marla

NA 11.8k 1.2m 12y
Consider IntIndex is the Index of newle inserted row in the GridView

TextBox m=MyGridView.Rows[IntIndex].FindControl("MyTextbox") as TextBox;
if(m!=null)
{
        m.Focus();
}

Hope it helped.
Check answer as correct if it helped