?
Solved

Click twice for dataload into listbox

Posted on 2009-05-20
10
Medium Priority
?
258 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

770 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