Click here to Skip to main content
15,899,314 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a gridview with datasource1 and i have a dropdownlist with datasource2 i search the gridview by using dropdownlist.

The problem is when i search and try to update the resulted record the gridview is refreshed and the update goes to first record in the database table(ie first record in the gridview)

I used Template Field for the Primary Key field which is set to auto incriment

C#
<asp:TemplateField HeaderText="SI.No.">
                            <itemtemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </itemtemplate>

How to solve this problem?
Posted
Updated 2-Nov-11 0:02am
v3

1 solution

Hi Krishna,

Please be more specific
I cant figure out what you wanna achieve
 
Share this answer
 
Comments
krishna_goluguri 3-Nov-11 4:26am    
1.I have a gridview1 and sqldatasource1 for that gridview in design mode i assigned sqldatasource1 to gridview1
2.i have 3 dropdownlists each have different fields like Country State aand City
3.I select three of them and click on search the result is shown according to the country state and city
4.when i try to edit any of the result (ie when i click on edit on the gridview) the edit is goes to first record in the database
5.that means if there are 10 records when i searched if the result is 8 and 9 th records if i wanted to modify 8th record the edit field goes to 1st record
6.I need a situation like when i try to edit 8 and 9 th records must be there and i have to edit 8th record then when i click on reload it has to reload whole gridview

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