SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
protected void OnRowCommand(object sender, GridViewCommandEventArgs e)
            if (e.CommandName == "Select")
                GridViewRow row = (GridViewRow)((LinkButton)e.CommandSource).NamingContainer;
                int index = row.RowIndex;
                int employeeID = Convert.ToInt32(GridViewNewsFeed.DataKeys[index].Value);

<asp:TemplateField  HeaderText="Title" >



I get this error ... DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'employeeID'.

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.