[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Click twice for dataload into listbox

Posted on 2009-05-20
10
Medium Priority
?
266 Views
Last Modified: 2013-12-17
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
0
Comment
Question by:Mr_Shaw
[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
  • 6
  • 2
  • 2
10 Comments
 
LVL 20

Accepted Solution

by:
informaniac earned 1000 total points
ID: 24432625
Make sure u have checked for the IsPostBack Condition in page load where you might have written code to bind the grid.
0
 

Author Comment

by:Mr_Shaw
ID: 24432667
I am not sure what you mean

page_load and the code benhind the grid and two seperate sections
0
 
LVL 20

Expert Comment

by:informaniac
ID: 24432874
Where have u written code to bind the grid? in  Page load
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Mr_Shaw
ID: 24433044
I have tried running my code both inside  and outside of

if (Page.IsPostBack)
        {
}
0
 

Author Comment

by:Mr_Shaw
ID: 24433255
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
0
 
LVL 11

Assisted Solution

by:srikanthreddyn143
srikanthreddyn143 earned 1000 total points
ID: 24433269
Move the focus out of gridview in click event
0
 

Author Comment

by:Mr_Shaw
ID: 24433307
what do you mean by move the focus.... do you think you could give me an example?
0
 
LVL 11

Expert Comment

by:srikanthreddyn143
ID: 24433448
When Edit button is clicked, Make the focus move to any other control like txtboxx1.focus()
0
 

Author Comment

by:Mr_Shaw
ID: 24433478
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
0
 

Author Closing Comment

by:Mr_Shaw
ID: 31583546
thanks for the help....

It ended up being the way I ordered my code.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 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