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

What is a user session?

501


What is repository pattern in mvc.net? : asp.net mvc

526


What is form method?

497


Where can I get information on cookies in asp.net?

566


Where do the cookie state and session state information be stored?

512






What is the difference between trace and debug in asp.net?

617


What are the event handlers that can be included in the Global.asax file?

578


Is a dll file an executable?

553


What's the difference between viewstate and sessionstate?

570


What does asp in asp.net stand for?

521


Where session id is stored?

535


How long should a session id be?

525


What is full form of asp.net?

521


What are the benefits of view state?

552


How can we create a website?

534