This is a migrated thread and some comments may be shown as answers.

RadGrid from SP2010 Webpart Column aggregates

12 Answers 122 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Christof
Top achievements
Rank 1
Christof asked on 04 Jun 2011, 10:28 AM
is it possible to use the aggregates of grouped columns and other functionalities also in sharepoint 2010 environment.
The Columns definition as described in help is missing ?!

<telerik:GridBoundColumn Aggregate="Count" DataField="CustomerID" DataType="System.String"
  HeaderText="CustomerID" SortExpression="CustomerID" UniqueName="CustomerID">
</telerik:GridBoundColumn>


Here is the code of my webpart:
<WpNs1:TelerikSPRadGridWebPart runat="server" __MarkupType="xmlmarkup" WebPart="true" __WebPartId="{A4DEC18D-8081-41BC-95C2-3891DA62D7D2}" ><WebPart xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.microsoft.com/WebPart/v2">
  <Title>Marketing Research</Title>
  <FrameType>None</FrameType>
  <Description>Telerik SPRadGrid Web Part</Description>
  <IsIncluded>true</IsIncluded>
  <ZoneID>g_35F88101A875412AA8912B7EAAF29F1A</ZoneID>
  <PartOrder>2</PartOrder><FrameState>Normal</FrameState><Height /><Width /><AllowRemove>false</AllowRemove><AllowZoneChange>false</AllowZoneChange><AllowMinimize>false</AllowMinimize><AllowConnect>true</AllowConnect><AllowEdit>false</AllowEdit><AllowHide>false</AllowHide><IsVisible>true</IsVisible><DetailLink /><HelpLink /><HelpMode>Modeless</HelpMode><Dir>Default</Dir><PartImageSmall /><MissingAssembly>Cannot import this Web Part.</MissingAssembly><PartImageLarge /><IsIncludedFilter /><ExportControlledProperties>true</ExportControlledProperties><ConnectionID>00000000-0000-0000-0000-000000000000</ConnectionID><ID>g_a4dec18d_8081_41bc_95c2_3891da62d7d2</ID><SqlDataStructure xmlns="Telerik.Ajax.SharePoint"><Connection><IntegratedSecurity>false</IntegratedSecurity></Connection><Columns /><DetailTables /><Relations /><PrimaryKeys /><EnableSorting>false</EnableSorting><EnablePaging>false</EnablePaging><EnableFiltering>false</EnableFiltering><EnableRowSelect>false</EnableRowSelect><EnableContextMenu>false</EnableContextMenu><EnableColumnReorder>false</EnableColumnReorder><AllowInsert>false</AllowInsert><AllowUpdate>false</AllowUpdate><AllowDelete>false</AllowDelete><AllowSelection>false</AllowSelection><AllowMultipleSelection>false</AllowMultipleSelection><PagerMode>NextPrev</PagerMode><Layout>Grid</Layout><InsertItemPosition>None</InsertItemPosition><Skin>Simple</Skin><UserInternalEditing>false</UserInternalEditing></SqlDataStructure><SPListDataStructure xmlns="Telerik.Ajax.SharePoint"><DetailTables /><Relations /><EnableSorting>false</EnableSorting><EnablePaging>false</EnablePaging><EnableFiltering>false</EnableFiltering><EnableRowSelect>false</EnableRowSelect><EnableContextMenu>false</EnableContextMenu><EnableColumnReorder>false</EnableColumnReorder><ShowGroupFooter>true</ShowGroupFooter><AllowInsert>false</AllowInsert><AllowUpdate>false</AllowUpdate><AllowDelete>false</AllowDelete><AllowSelection>false</AllowSelection><AllowMultipleSelection>false</AllowMultipleSelection><PagerMode>NextPrev</PagerMode><Layout>Grid</Layout><InsertItemPosition>None</InsertItemPosition><Skin>Simple</Skin><UserInternalEditing>false</UserInternalEditing></SPListDataStructure><ViewID xmlns="Telerik.Ajax.SharePoint">00000000-0000-0000-0000-000000000000</ViewID><ShowToolbar xmlns="Telerik.Ajax.SharePoint">false</ShowToolbar><EnableHeaderContextMenu xmlns="Telerik.Ajax.SharePoint">false</EnableHeaderContextMenu><EnableInserting xmlns="Telerik.Ajax.SharePoint">false</EnableInserting><EnableEditing xmlns="Telerik.Ajax.SharePoint">false</EnableEditing><EnableDeleting xmlns="Telerik.Ajax.SharePoint">false</EnableDeleting><Skin xmlns="Telerik.Ajax.SharePoint">Windows7</Skin><BindingMode xmlns="Telerik.Ajax.SharePoint">SPListSingle</BindingMode><ListID xmlns="Telerik.Ajax.SharePoint">94de5d0f-7f51-4c89-9e65-26c5074250bf</ListID></WebPart></WpNs1:TelerikSPRadGridWebPart>

Regards and help for support

Chris

12 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 08 Jun 2011, 06:41 PM
Hello Christof,

 There should be no problem enabling the group footer aggregates in Sharepoint as well. Your grid declaration should look similar to the one in this live demo.

All the best,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Christof
Top achievements
Rank 1
answered on 08 Jun 2011, 07:17 PM
this means i have to create the structure by myself and cant use the given by the designer.
Is this correct?
I did hope to beeing able to use the designer created code as a starting plattform.

best regards
Christof
0
Marin
Telerik team
answered on 13 Jun 2011, 11:45 AM
Hello Christof,

 When you create a Sharepoint Visual Web Part project in Visual Studio you can add RadGrid to the user control for the web part and use the RadGrid designer in Visual Studio to configure the structure and set column aggregates. More information is available in this help topic.

Greetings,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Christof
Top achievements
Rank 1
answered on 13 Jun 2011, 11:52 AM
My Point is:
i am not using VS i do it with Sharepoint Designer.
And so i did not try to build my own webpart but would like to use your webpart.
Could i do the job:
-colum agregates and grouping
- Filtering by querystring

with customizing your webpart or do i need to develop my own wp??

br

Christof
0
Marin
Telerik team
answered on 14 Jun 2011, 02:03 PM
Hello Christof,

 In order enable grouping aggregates you should bind to SP Lists that are configured to aggregate (group) the data so that the grid can show the aggregates automatically. Filtering can be enbled from the SP RadGrid web part designer. Currently filtering by query by string is not supported out of the box.

Greetings,
Marin
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
Christof
Top achievements
Rank 1
answered on 16 Jun 2011, 01:34 PM
Hi,

i configured the list view with agregates. It works in th list view but not in rad grid.
Btw: Same behaviour with rounding.
regards

Christof
0
Raph
Top achievements
Rank 1
answered on 20 Nov 2014, 06:00 AM
I need to add a custom property to a radgrid that lets me choose the datasouce(SP list).How do I go about on implementing that?
0
Marin
Telerik team
answered on 20 Nov 2014, 09:22 AM
Hi,

It depends what you are building:
 - if you want a web part with RadGrid that can bind to SPList you can add a standard web part property that can be configured through the web part editor and chose the SPList there. That's pretty much what the SPRadGridWebPart provides.
Another option is to add such property by inheriting the RadGrid control and improving its databinding to handle SPList objects. Fortunately this is too already implemented. In the Telerik.Ajax.SharePoint.dll assembly that you get when you install the Telerik Web Parts there is a SPRadGrid control. It is basically a RadGrid that allows databinding to SPList. You can use the NeedDataSource event and pass the SPList directly to the control:
protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        RadGrid1.List = someSPList;
        RadGrid1.DataSource = someSPList;
    }


Regards,
Marin
Telerik
 
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
 
0
Raph
Top achievements
Rank 1
answered on 20 Nov 2014, 09:30 AM
Marin,

In my radgrid I am binding the sp list using code(GridDataBound columns).What I need is an OOTB component(or custom component if that is not possible) that lets me change my data source to another list/excel file in my SP web page itself. No code changes should be involved in it to enhance reusability. In my web part properties I should get an option to change the list which is populating the grid,choose columns etc. as an end user.

Does SPradgridwebpart provide this functionality?
0
Marin
Telerik team
answered on 20 Nov 2014, 09:55 AM
Hello Raph,

You can check the features that the SPRadGridWebPart provides here:
http://sharepoint.telerik.com/aspnet-ajax/web-parts/Pages/Single-List-Binding.aspx

When the web part is in edit mode you can pick a SPList that will be used to databind the grid in the web part. Similar configuration is also available through the custom web part designer which also lets you change settings and pick datasource for the web part.
Another option is to mimic this same behavior in your web part so that when it is in edit mode it allows a SPList to be picked which on postback will be set as datasource for the RadGrid to show the new data.

I hope this helps. Let me know if you have any other questions.

Best Regards,
Marin
Telerik
 
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
 
0
Raph
Top achievements
Rank 1
answered on 20 Nov 2014, 10:08 AM
Thank you for the timely response Marin. I will look implementing the SPRadGridWebPart in my scenario. Also, about implementing the same in my webpart,any pointers on how to do that?

Thanks in advance.
0
Marin
Telerik team
answered on 20 Nov 2014, 12:42 PM
Hello,

Implementing similar features in your web part may require some additional custom code. For example you can add a custom property where you keep the name of the SPList you want to bind to:
http://msdn.microsoft.com/en-us/library/dd584174(v=office.11).aspx
You can also modify the built-in toolpart editor of the web part so that the user can enter or pick the name of the SPList when the web part is in edit mode. Further guidance can be found here:
http://msdn.microsoft.com/en-us/library/dd584178(v=office.11).aspx

Once you have the name of the SPList - you can find it by using the Sharepoint server-side API and bind the RadGrid to it.
The SPRadGridWebPart for example creates the whole RadGrid control in code behind in the default CreateChildControls or CreateControlHierarchy methods from the base WebPart class and after all the settings and structure of the control is setup there it proceeds to handle the NeedDataSource event of the grid and set the datasource there.

I hope this helps. Let me know if you have any other questions.

Best Regards,
Marin
Telerik
 
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
 
Tags
WebParts for SharePoint
Asked by
Christof
Top achievements
Rank 1
Answers by
Marin
Telerik team
Christof
Top achievements
Rank 1
Raph
Top achievements
Rank 1
Share this question
or