SharePoint WebPart Connections

8 posts, 0 answers
  1. Gary Park
    Gary Park avatar
    2 posts
    Member since:
    Sep 2012

    Posted 09 Mar 2011 Link to this post

    Hello,

    I am just having a play with the SharePoint WebParts in the Telerik SharePoint Acceleration Kit, and I had a question.

    Is there any way for the WebParts to get the data to display through a WebPart Connection, rather than from a place (SQL Server, SharePoint List, Excel) defined within the WebPart itself?

    Thanks

    Gary
  2. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 09 Mar 2011 Link to this post

    Hi Gary,

    The grid web part does not support such a functionality out of the box. You need to use the RadGrid control in a custom web part of yours and implement the connection between the consumer and the provider.

    All the best,
    Tsvetoslav
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!

  3. Gary Park
    Gary Park avatar
    2 posts
    Member since:
    Sep 2012

    Posted 09 Mar 2011 Link to this post

    Hello,

    I thought that is what you were going to say :)

    We are currently already doing that, I was just wondering if, with this new release, whether we didn't have to continue down this route or not.

    Thank you for taking the time to get back to me.

    Gary
  4. Emir
    Emir avatar
    3 posts
    Member since:
    Jul 2011

    Posted 19 Jul 2011 Link to this post

    Hi Tsvetoslav,

    I am new to the SharePoint environment and Telerik products and I believe my question is related to this thread. I would like to add RadGrid to an application page in SharePoint and use a list in the SharePoint site as the source for this grid. I have looked at the forum pages, sample codes, tutorials, etc. (http://www.telerik.com/support/documentation-and-tutorials.aspx) but could not find any usage of this kind. Could you help me out on this issue? Is it impossible or is there a way to configure it?

    Kind regards.

    Emir Gocen
  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 19 Jul 2011 Link to this post

    Hi Emir,

    You may be interested in putting our SP 2010 AJAX grid web part into practice to achieve your goal - it provides flexible server/client binding to SP Lists (internal or external) out-of-the-box. See the resources linked below for more details:

    http://www.telerik.com/products/sharepoint/aspnet-ajax.aspx
    http://blogs.telerik.com/aspnet-ajax/posts/11-07-11/telerikspradgrid-q2-2011-new-features-and-improvements.aspx

    This web part is part of our SharePoint Acceleration Kit CTP, you may want to give it a spin and leave your feedback.

    Best regards,
    Sebastian
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  6. Emir
    Emir avatar
    3 posts
    Member since:
    Jul 2011

    Posted 20 Jul 2011 Link to this post

    Hi Sebastian,

    I had installed SharePoint Acceleration Kit previously and its usage is very straight forward (thanks for sharing the new features link -
    http://blogs.telerik.com/aspnet-ajax/posts/11-07-11/telerikspradgrid-q2-2011-new-features-and-improvements.aspx), I do not have any problems with that. However, I believe I need to use RadGrid (mentioned in http://www.telerik.com/products/sharepoint/aspnet-ajax.aspx) to be able to integrate gridview to an application page in a SharePoint site. In here, I want to use a list in the SP site as the source for the grid and what the user will see/edit in the grid (depending on the credential he/she has)  should be defined in the code behind. I have looked at many examples in your site (http://demos.telerik.com/aspnet-ajax/grid/examples/programming/simplebinding/defaultcs.aspx - upon loading it gave a default web.config error rightaway, http://www.telerik.com/community/forums/aspnet-ajax/grid/in-sharepoint-replace-listview-with-radgrid.aspx - is the feature mentioned in here defined with the current version or do i have to go through the procedure stated?, http://sharepoint.telerik.com/silverlight/Pages/Demo.aspx - is it a SPGrid or RadGrid used in this page?) but could not find an applicable solution. I would appreciate a little bit of aid from you. Is there a SharePoint solution, which has implemented RadGrid on the aspx page and SPList as the data source, in your site?

    Kind regards.

    Emir Gocen
  7. Emir
    Emir avatar
    3 posts
    Member since:
    Jul 2011

    Posted 21 Jul 2011 Link to this post

    Hi Sebastian,

    I have progressed a little bit but bumped into another barrier. I am using a SPList as the source to fill in a datatable and I set the datatable to RadGrid.DataSource. In here, I want to show just one column and I want to have all grid properties enabled to the end-user (paging/sorting/etc.). I need help on the paging property, from the forum pages I learned that I should use OnNeedDataSource in Advanced Binding so that paging functionality works properly but I can't pass beyond the second page. What is missing in my code?

    Kind regards.

    Emir Gocen

    My code on the aspx page:
    <telerik:radgrid id="RadGrid1" allowfilteringbycolumn="true" allowpaging="true" 
                       allowsorting="true" skin="Windows7" pagesize="2" autogeneratecolumns="false" 
                       OnNeedDataSource = "RadGrid1_NeedDataSource" height="200" width="200" runat="server">
      <MasterTableView>
           <Columns>
               <telerik:GridBoundColumn DataField="Title" HeaderText="Harcama Kalemi"/>
           </Columns>
      </MasterTableView>
    </telerik:radgrid>

    The code-behind:
    protected void Page_Load(object sender, EventArgs e)
        {
          LoadData();
        }
      
        private void LoadData()
        {
          using (SPWeb oWeb = SPContext.Current.Web)
          {
            SPList myList = oWeb.Lists["Harcama Raporu"];
            SPView myView = myList.Views[1];
            DataTable mytable = myList.GetItems(myView).GetDataTable();
            RadGrid1.DataSource = mytable;
            RadGrid1.DataBind();
          }
        }
      
        protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
          LoadData();
        }
  8. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts

    Posted 21 Jul 2011 Link to this post

    Hi Emir,

    Just do the following modifications to your code:

    1. Remove the call to the LoadData() method from the Page_Load event.

    2. Remove the call to the grid's DataBind() method (RadGrid1.DataBind() ) from the LoadData() method.

    Hope it helps.

    Greetings,
    Tsvetoslav
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Back to Top