0

I want the values without using cells as they might change later and the values i want are not primary key so i cant put them in datakeys so how can i get values in RowCommand event

I am getting Null value for this

strRequestMedium = Convert.ToString(DataBinder.Eval(e.Row.DataItem, "RequestMedium"));

I tried to use row which was already getting me values from labels for ex:

   GridViewRow row = (GridViewRow)(((Control)e.CommandSource).NamingContainer);

        strRequiredByDate = Convert.ToString(((Label)row.FindControl("lblRequiredDateTime")).Text);

But this was also not working as it is not allowed or something

BKM
  • 186
  • 2
  • 15
  • Can you add some html and the actual method you're trying to do this in? The 2nd looks like an idea. What's the error or problem? – wazz Nov 06 '19 at 06:14
  • 1
    You can put multiple keys in `datakeys` and letter you can get these value. [Refer this link](https://stackoverflow.com/questions/45366234/how-to-work-with-multiple-datakeys-in-gridview) – शेखर Nov 06 '19 at 06:20
  • even if they are not primary keys ? @shekhar ? – BKM Nov 06 '19 at 06:38

0 Answers0