Solved

Using a custom edit in a gridview

Posted on 2008-10-19
3
768 Views
Last Modified: 2013-11-07
I am using a gridview where it lists all of the listings by the current user. I also want to give the user the ability to edit that listing as well. I am using a link button to be able to accomplish this.

What I want the link button to do is have the user directed to another web page that will display all of the information about this particular listing and give him/her the ability to edit any particular part of that listing. Once that is complete, he/she is directed back to his "home page".

Where I am having problems is I am unable to put in the code that is necessary to accomplish this. I am hoping someone here can guide me in the right direction.
0
Comment
Question by:smitty68521
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Gyanendra Singh earned 500 total points
ID: 22755364
See for achieving your result there is 2 way
1.  you need to set the datakeynames property in yr gridview and on grdiview editing event you need to retrive datakey and pass it through querystring in another page

2. go to LINK button propeties....... (i think its Button (link type)

like ....(right click one gridview ---> smart tag----->.EDIT Coloumns---->

 editlink button properties  ( set the COMMANDNAME as Edit)

now ur code behine window

at the GRIVIEW rowcommand event

protected void GridView2_RowCommand(object sender, GridViewCommandEventArgs e)
{

if (e.CommandName == "Edit")
{

   int index = Convert.ToInt32(e.CommandArgument);
  GridView customersGridView = (GridView)e.CommandSource;

   GridViewRow row = customersGridView.Rows[index];
     response.redirect("URaspxname.aspx?querystringname1=row.Cells[urNeedCELLNO].Text.Trim()&querystingname1=row.Cells[urNeedCELLNO].Text.Trim());


}
}

0
 
LVL 1

Author Closing Comment

by:smitty68521
ID: 31508102
This helped out a lot. Thanks for your help.
0
 
LVL 16

Expert Comment

by:Gyanendra Singh
ID: 22764518
yr welcome
0

Featured Post

[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question