Reylin Mathew

Reylin Mathew

  • NA
  • 347
  • 71.4k

how to get multiple datakeys in gridview using button click

Jan 18 2019 12:34 AM
 I have a gridview with 2 datakeysname ie date and day.
This is my code :
 
foreach (GridViewRow row in gvCalenderData.Rows)
{
int date =Convert.ToInt32(gvCalenderData.DataKeys[row.RowIndex].Values[0].Tostring);
Session["cal_date"] = date;
string day = gvCalenderData.DataKeys[row.RowIndex].Values[1].ToString();
Session["cal_day"] = day;
 
 but i got this type of error '' Input string was not in a correct format. '' 
 
 

Answers (1)