hi i have a problem regarding to datagrid in aspdotnet.i
have a datagrid in my application.i have to place
add,edit,delete buttons or links what ever it may be.
now the problem is if i click on add button then the page
has to redirected to another form called "xyz.aspx" and if
i click on edit button the page has to redirected to
another form called "abc.aspx".i am phasing the problem
that if where ever i click on the datagrid the cursor goes
to gv1_SelectedIndexChanged event.please tell me the
solution about the code.

Answer Posted / anant anand gupta

You can use the ItemCommand event of the datagrid.
give each command button a 'CommandName'
And 'CommandArgument' if required. CommandArgument you can
assign at the time of ItemDataBound (or RowDataBound) event
of the DataGrid. In the event handler method you can check
for the command name and perform the required task.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what does mvc represent in asp.net? : asp.net mvc

506


How many types of controls are there in asp.net?

530


Explain Optimization technique description?

606


How can we secure the data which is send from client side to server? Like the login id and paasword needs to be authenticated on the server but we cannot send it in plain text into the server.One more thing we are not using the SSL here.

1430


What is the life-span of the items in the viewstate?

505






Can you clarified A Web service can only be written in .NET or not?

542


Explain culture and uiculture values.

551


What symbol would you use to denote, the start of a code block in aspx views?

577


What is session in asp.net?

529


Why would a company use an application service provider?

496


How to store checkbox value in database in asp.net mvc? : Asp.Net MVC

523


Explain a program using razor view engine to create a simple application? : asp.net mvc

505


What is active web pages?

513


How can we update records in gridview?Is there any appropriate code for it?

1608


What do you mean by caching in asp.net?

556