Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear Experts,

My project is based on Asp.net c#,Sql2005 Database.

on my webpage i have gridview with checkboxes, In this gridview i have one column with name Messages.

below this gridview i have submit button to save this data.

when i select one checkbox and click on submit button. a popup message must be displayed with checkbox selected row in popup box.

Please can you help me.

thanks.
Posted
Comments
Azee 3-Oct-13 5:32am    
Can please you post your code as well?
Thanks7872 3-Oct-13 5:41am    
So whats the question? What have you tried?
Member239258 3-Oct-13 6:34am    
my requirement is :

I have gridview with checkboxes, below this gridview i have submit button.

when i select checkbox and click on submit button, a popup message must be displayed after submit button click.

In this popup message i need checkbox selected value on submit button click.

Please help.

1 solution

You can try something like this

C#
protected void Submit_Click(object sender, EventArgs e)
{

    // Iterate through the Gridview Rows property
    foreach (GridViewRow row in Gridview1.Rows)
    {
        // Find the CheckBox
        CheckBox cb = (CheckBox)row.FindControl("CbID");
        if (cb != null && cb.Checked)
        {

            var selVal= GridView1.DataKeys[row.RowIndex].Value;
            // "Delete" the row
            lblSelected.Text += Convert.Tostring(selVal);
        }
    }

}


Then Add a panel with a modal popup which consists of a control ( here just i have used label ) to display the selected values in it and associate the modal popup targetid with the Submit button . Add a simple javascript if you want to use it that way.

Hope this helps
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900