Sign up ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
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.