How to bind spgridview in sharepoint

Advertisement
In this Article I will explain how to bind the SPGridView in SharePoint.


public void bindSPGrid()
        {
            SPWeb currentWeb = SPContext.Current.Web;
            SPList list = currentWeb.Lists["ListName"];
            SPListItemCollection myListColl = list.Items;
            if (myListColl.Count > 0)
            {

                spgridview.DataSource = myListColl.GetDataTable();
                spgridview.DataBind();
        }
            }

Don’t forget to call this method in
PageLoad
Advertisements
SHARE

Lakshmi Tulasi Jasti

  • Image
  • Image
  • Image
  • Image
  • Image
    Blogger Comment
    Facebook Comment

0 comments:

Post a comment