473,387 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

gridview doesn't show data at first page load

Hi all,

I have a gridview populated with data coming from a dataset (created
via the wizard). The data shown in the gridview is dependent on the the
choice of a control (dropdown with autopostback enabled). When I load
the page for the first time I the gridview is empty. When I select
something in the dropdownlist the gridview is populated correctly. I
guess this has something to do with the fact that the first time no
data from the dropdownlist is send to the gridview.

Someone has an idea on how to solve this?

Regards,
Stijn

Aug 29 '06 #1
3 10123
Stijn,

Somewhere in the ddl event handler you may have a piece a code that
populates the grid. Try to locate it and copy it over to the Page_Load
event.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ta******@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all,

I have a gridview populated with data coming from a dataset (created
via the wizard). The data shown in the gridview is dependent on the the
choice of a control (dropdown with autopostback enabled). When I load
the page for the first time I the gridview is empty. When I select
something in the dropdownlist the gridview is populated correctly. I
guess this has something to do with the fact that the first time no
data from the dropdownlist is send to the gridview.

Someone has an idea on how to solve this?

Regards,
Stijn

Aug 29 '06 #2
Thanks for the fast reply. since I'm a beginning .NET programmer I have
a hard time understanding the answer. Can you please explain me where I
can find the DLL event handler?

Also, when adding this to Page_Load, won't this then happen every time
the page loads. Thus over writing the user selection via the the drop
down lists?

Regards,
Stijn
Eliyahu Goldin schreef:
Stijn,

Somewhere in the ddl event handler you may have a piece a code that
populates the grid. Try to locate it and copy it over to the Page_Load
event.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ta******@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
Hi all,

I have a gridview populated with data coming from a dataset (created
via the wizard). The data shown in the gridview is dependent on the the
choice of a control (dropdown with autopostback enabled). When I load
the page for the first time I the gridview is empty. When I select
something in the dropdownlist the gridview is populated correctly. I
guess this has something to do with the fact that the first time no
data from the dropdownlist is send to the gridview.

Someone has an idea on how to solve this?

Regards,
Stijn
Aug 29 '06 #3
You have a dropdown list (ddl, not dll) with autopostback enabled. This
means when you change the ddl selection, a postback fires. Did you setup
SelectedIndexChanged event for the ddl? If you didn't, a postback will still
fire and the page will get loaded on the server. The code in Page_Load event
will run. You can use IsPostBack property to tell between the first page
load and the postbacks. This is the answer on your second question.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ta******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Thanks for the fast reply. since I'm a beginning .NET programmer I have
a hard time understanding the answer. Can you please explain me where I
can find the DLL event handler?

Also, when adding this to Page_Load, won't this then happen every time
the page loads. Thus over writing the user selection via the the drop
down lists?

Regards,
Stijn
Eliyahu Goldin schreef:
>Stijn,

Somewhere in the ddl event handler you may have a piece a code that
populates the grid. Try to locate it and copy it over to the Page_Load
event.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
<ta******@gmail.comwrote in message
news:11**********************@h48g2000cwc.googleg roups.com...
Hi all,

I have a gridview populated with data coming from a dataset (created
via the wizard). The data shown in the gridview is dependent on the the
choice of a control (dropdown with autopostback enabled). When I load
the page for the first time I the gridview is empty. When I select
something in the dropdownlist the gridview is populated correctly. I
guess this has something to do with the fact that the first time no
data from the dropdownlist is send to the gridview.

Someone has an idea on how to solve this?

Regards,
Stijn

Aug 29 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Miguel Dias Moura | last post by:
Hello, I have a GridView in my page which is created in runtime. It works fine. My page has 2 Asp Buttons: - The HIDE button makes GridView.Visible = False; - The SHOW button makes...
5
by: Amit | last post by:
Hello, I have a simple search screen, with two drop-downs and a text box. There's also a GridView control that is using a SqlDataSource control to show the matching results. The SqlDataSource uses...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
0
by: DC | last post by:
The problem I'm using the .NET GridView and FormView objects for the first time and im getting the error "An OleDbParameter with ParameterName '@ID' is not contained by this...
1
by: jmdolinger | last post by:
Hi all, I'm a newbie to Atlas (and recently ASP.NET) after coming from a long Java background, also have done quite a bit with an Ajax.NET/ASP.NET 1.1 project, but it was basically all...
4
by: =?Utf-8?B?Vmlua2k=?= | last post by:
Hello Everyone, I have a gridview. I am using template columns inside the gridview. When I display the gridview on the web page and if there is no value in a particular cell, gridline disappaers...
0
by: Ty | last post by:
I have a page that has three gridviews on it. In each gridview the first column is a link button representing a Database ID field. What I'm trying to accomplish is to email that page and click on...
8
by: Nick | last post by:
Hi there, I have a GridView in an UpdatePanel, each time the UpdatePanels Load event fires I set the DataSource and call DataBind of the grid view. This works great once, I add an item to the...
4
by: ahling | last post by:
Hi all. As mentioned in my first post, I'm currently doing an asp.net blog where user can update their profile, and update their blog entry. But I encountered problem with the update of entry...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.