I want know how to use the grid view in a SharePoint-hosted App. Can any one provide information on this?

1 Answer 1


You can use built-in server controls in a SharePoint-Hosted app. You just can't use any code-behind. The markup for the various data source and UI controls remains the same.

<SharePoint:SPDataSource ID="SPDataSource1" runat="server"            
    SelectCommand="<Query></Query>" >
        <asp:Parameter name="ListName" DefaultValue="Contacts" />
<SharePoint:SPGridView ID="SPGridView1" runat="server"
        <SharePoint:SPBoundField DataField="Title" HeaderText="Last Name" />
        <SharePoint:SPBoundField DataField="First Name" HeaderText="First Name" />
        <SharePoint:SPBoundField DataField="Company" HeaderText="Company" />
        <SharePoint:SPBoundField DataField="Business Phone" HeaderText="Work Phone" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.