469,575 Members | 1,651 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,575 developers. It's quick & easy.

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 9909
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by jmdolinger | last post: by
4 posts views Thread by =?Utf-8?B?Vmlua2k=?= | last post: by
8 posts views Thread by Nick | last post: by
4 posts views Thread by ahling | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.