This is a migrated thread and some comments may be shown as answers.

Add, edit ,delete in grid view

1 Answer 102 Views
GridView
This is a migrated thread and some comments may be shown as answers.
A2H
Top achievements
Rank 1
A2H asked on 07 Jul 2011, 08:59 AM
Hi,

I am developing a windows application.

In that I have a form with a gridview placed on that.

In form I have Update button also.

When user selects one row and click on update ,it has to redirect to another form with the selected data and user can enter details in that and when user click on update data should saved back to database.

How can i acheive this,specifically redirecting to another form with selected records and on click on update button how to save this to database

Please help me,if anyone can post some code snippets then it would be great.

1 Answer, 1 is accepted

Sort by
0
komathi priya
Top achievements
Rank 1
answered on 08 Jul 2011, 11:53 AM
Page_Load(object sender, EventArgs e)
{
            RadGrid1.SelectedIndexes.Add(0);
        }

        protected void RadGrid1_DataBound(object sender, EventArgs e)
        {
            GridDataItem selectedItem = RadGrid1.Items[0];
            Session[EmployeeID] = selectedItem["EmployeeID"].Text;
           
        }

protected void btnUpdate_Click()
{
           redirect to another form by passing the session value
}

In the other form load get the values from database and update in that form's update button click.

Tags
GridView
Asked by
A2H
Top achievements
Rank 1
Answers by
komathi priya
Top achievements
Rank 1
Share this question
or