473,395 Members | 1,629 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,395 software developers and data experts.

Gridview DataKeys property not set when PageIndexChanged fires

In the PageIndexChanged event of an ASP.Net 2.0 GridView the Rows property
has rows but the DataKeys property has 0 Items ?

This definitely seems like a bug to me. Has anyone come up with a good
workaround ?

--
Rick Droske
Dec 13 '06 #1
1 4147
DataBinding the GridView again at the top of PageIndexChanged fixes it but
obviously not ideal. Hopefully its not actually causing another trip to the
SQL server....
--
Rick Droske
"Rick Droske" wrote:
In the PageIndexChanged event of an ASP.Net 2.0 GridView the Rows property
has rows but the DataKeys property has 0 Items ?

This definitely seems like a bug to me. Has anyone come up with a good
workaround ?

--
Rick Droske
Dec 13 '06 #2

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

Similar topics

1
by: Mark Richards | last post by:
I posted this earlier, and got no response. Basically I need to be able to grab a value from one of the fields in a gridView to populate a dropdown in another column of the gridview: I have a...
1
by: Mike P | last post by:
When you use a SqlDataSource to hook up data to a GridView it seems to be to be very inflexible. For example, I want to create my own Delete button with my own code and I also want to create a...
2
by: Narshe | last post by:
I have a gridview with datakeyname="Id" that is using a sqldatasource. When I click delete on the gridview, the datakeys property is empty during the deleting event.
3
by: Mike P | last post by:
When I am performing a command on a row in my gridview, it works fine, unless I have paging enabled and I try t execute the command on a page other than the first page. The error I get is 'Index...
6
by: Greg | last post by:
Hello, I have a GridView bound to a custom object. I set the DataKeyNames property along with the column DataField properties at design time, and bind the GridView to my object at run-time. In...
3
by: shapper | last post by:
Hello, I need to loop though each row in a GridView and if the checkbox is a Template Field is checked I want to display the value of an invisible column named "LevelName". I tried everything...
9
by: Mel | last post by:
I have 10 columns total. 3 of them are invisible. The rest are read- only BoundFields, 3 of which are editable fields using TemplateFields. Upon editing, I want to validate what the user enters...
1
by: jc | last post by:
Duh.. How do I do this? CreditId is my datakey, but I can't seem to get to it. Dim dgItem As GridViewRow For Each dgItem In gridEmployeeCredits.Rows If dgItem.DataItem("CreditId") = 0 Then...
4
by: Peter | last post by:
I want to call a JavaScript on PageIndexChanged event, how do I do that? Thank You Peter
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: 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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.