BKM
BKM

Reputation: 186

How do i get value of DataBinder.Eval in RowCommand without using cell index or DataKey

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

Upvotes: 0

Views: 201

Answers (0)

Related Questions