Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


(int) DataGrid2.DataKeys[(int) e.Item.ItemIndex]

Posted on 2005-04-25
Medium Priority
Last Modified: 2010-04-07
does anyone has any idea why (int) DataGrid2.DataKeys[(int) e.Item.ItemIndex]  - specifically DataGrid2.DataKeys will not have any count records on one page and yes on another?

Question by:epmo
  • 2
  • 2
LVL 12

Accepted Solution

laotzi2000 earned 2000 total points
ID: 13861657
It depends on whether the DataKeyField attribute of the datagrid is set or not.

Author Comment

ID: 13861952
how do you set it?
LVL 12

Expert Comment

ID: 13862086
I think you should have figured it out.

Like this:
<asp:datagrid id="details" runat="server" Height="370px" Width="850px" AutoGenerateColumns="False" DataKeyField="ID" >

Author Comment

ID: 13862172
Thank you!

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

564 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