how to get value from gridview

Hi,

 I'm a beginner with ajax, i use visual studio 2005 and ajax is installed on my computer!

I have a gridview with a column select and on this column i'd like to put a link to a function javascript (alert)

for displaying some information about the row ?

Sample click on row 1 result : > alert('Your name is ' + UserName+ 'Your surname is : ' + Surnmae)

someone can help me to do that ? 

Thanks for all

Christophe

Read More

Advertisements

One thought on “how to get value from gridview

  1. Dam Thom

    <asp:Label ID=”lbAmount” Text=” runat=”server” >

    <asp:TextBox ID=”txtAmount” Text=” runat=”server” width=”20px”>

    protected void GridV_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
    //Get the values stored in the text boxes

    string Amount = ((TextBox)GridV.Rows[e.RowIndex].FindControl(“txtAmount”)).Text;
    string ID = GridV.DataKeys[e.RowIndex].Value.ToString();
    try
    {
    //Prepare the Update Command of the DataSource control
    SqlService.ExecuteNonQuery(“PR_UpDateTrainingProgram”, CommandType.StoredProcedure, “@ID_iTrainingProgram”, ID, “@iDVHT”, DVHT);
    ClientScript.RegisterStartupScript(GetType(), “Message”, “alert(‘Updated successfully!’);”);
    GridV.EditIndex = -1;
    LoadGridV();
    }
    catch (Exception ex) { Modul.ShowError(ex.ToString()); }

    }

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s