CodeVerge.Net Beta


   Explore    Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.faq_frequently_asked_questions Tags:
Item Type: NewsGroup Date Entered: 5/3/2007 12:46:18 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 0 Views: 174 Favorited: 0 Favorite
1 Items, 1 Pages 1 |< << Go >> >|
JananiSharma
Asp.Net User
Problem in Gridview Datakeynames5/3/2007 12:46:18 PM

0

Hi guys

       while i was working with asp.net 2003 i used the datakeys property of datagrid to delete or update.Otherwise i use the boundcolumn and set its visible property false.Like

i want to show the customer name,salary but i want cust_no which i dont wanto show.

Cust_no(visible-false) Cust_nm salary- and write code in itemdatabound event like

 

custno=e.item.cell[0].Text;

custno=grid.datakeys[e.item.itemuindex]; 

But the same thing i cant use in asp.net 2005,there cust_no is avail only if it is visible otherwise empty value is passed to custno.

So i used datakey names property i set it with cust_no,

and the query is "select cust_no,cust_nm,salary from cust_mst"

and i set cust_nm,salary in the bound field

But i got the following error:

Specified argument was out of the range of valid values. Parameter name: index

so i add the cust_no as boundfield and set its visible property false.

Its working.Any one please explain 

My question is why it displays error when i didnt use cust_no as boundfield?Eventhough i added the field in datakeynames 

 

 

 


 

1 Items, 1 Pages 1 |< << Go >> >|


Free Download:




   
  Privacy | Contact Us
All Times Are GMT