c# - Issue related to ItemCommand event in DataGrid asp.net -


i have asp.net application having datagrid on aspx page having autogenerated columns :

i have bound itemcommand event on grid following :

 protected void datagrid2_itemcommand(object sender, system.web.ui.webcontrols.datagridcommandeventargs e)         {             if (e.commandname == "checkinventoryandprice")             {                   string itemmainpagelink = e2wconstants.pages.item_main;                 string itemid = (datarowview)e.item.dataitem).row["itemid"].tostring();                  //response.redirect();             }         } 

but getting dataitem null : how can value of cell of selected row ??

thanks..


Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -