Link to home
Start Free TrialLog in
Avatar of Mr_Shaw
Mr_Shaw

asked on

Click twice for dataload into listbox

I have a gridview which when I click the gridview edit button it loads some values into a listbox.

My problem is that I have to click the edit button twice for this to happen. Is there a reason for this.

I am using c# and asp.net
ASKER CERTIFIED SOLUTION
Avatar of Obadiah Christopher
Obadiah Christopher
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Shaw
Mr_Shaw

ASKER

I am not sure what you mean

page_load and the code benhind the grid and two seperate sections
Where have u written code to bind the grid? in  Page load
Avatar of Mr_Shaw

ASKER

I have tried running my code both inside  and outside of

if (Page.IsPostBack)
        {
}
Avatar of Mr_Shaw

ASKER

Everything seems to be acting on the previous click.

for example to value selected in the 1st click was one
the value selected in the 2nd click was two.

When I click for the second time the 1st clicks values is processed. ahhhhhhhh
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mr_Shaw

ASKER

what do you mean by move the focus.... do you think you could give me an example?
When Edit button is clicked, Make the focus move to any other control like txtboxx1.focus()
Avatar of Mr_Shaw

ASKER

I'm really sorry to have to say this... but changing the focus does not help.

My code is always one click behind what I am actually doing,

Everything seems to be acting on the previous click.

for example to value selected in the 1st click was one
the value selected in the 2nd click was two.

When I click for the second time the 1st clicks values is processed. ahhhhhhhh
Avatar of Mr_Shaw

ASKER

thanks for the help....

It ended up being the way I ordered my code.