Hello,
I have a problem with collapsing radgrid items, when they're set to edit mode.
When I use javascript collapseItem() function, it's impossible to expand it later by user.
On the other hand, it's possible to collapse and expand items by user click - but again, not by running js onclick() method.
Any help would be appreciated.
I have a problem with collapsing radgrid items, when they're set to edit mode.
protected
void
Page_Load(
object
sender, EventArgs e)
{
for
(
int
i = 0; i < radGrid.PageSize; i++)
{
for
(
int
j = 0; j < radGrid.PageSize; j++)
{
radGrid.EditIndexes.Add(i, 0, j);
}
}
}
When I use javascript collapseItem() function, it's impossible to expand it later by user.
On the other hand, it's possible to collapse and expand items by user click - but again, not by running js onclick() method.
function
CollapseAll() {
var
grid = $find(
"<%= radGrid.ClientID %>"
);
master = grid.get_masterTableView();
for
(masterIndex = 0; masterIndex < master.get_dataItems().length; masterIndex++) {
master.collapseItem(masterIndex);
}
Any help would be appreciated.
11 Answers, 1 is accepted
0
Hello Paweł,
You can use the following code to collapse all items:
If you use _toggleGroupExpand function of the tableView, the user will be able to expand items later.
Greetings,
Vasil
the Telerik team
You can use the following code to collapse all items:
<script type=
"text/javascript"
>
function
CollapseAll(event) {
var
tableView = $find(
'<%=RadGrid1.ClientID %>'
).get_masterTableView();
var
rows = tableView.get_element().rows;
for
(
var
i = 0, len = tableView.get_element().rows.length; i < len; i++) {
var
button = tableView._getGroupExpandButton(rows[i]);
if
(button) {
var
groupLevel = button.id.split(
"__"
)[2];
if
(groupLevel == 0) {
tableView._toggleGroupsExpand(button, event);
}
}
}
}
</script>
If you use _toggleGroupExpand function of the tableView, the user will be able to expand items later.
Greetings,
Vasil
the Telerik team
Browse the vast support resources we have to jumpstart 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

Paweł
Top achievements
Rank 1
answered on 23 Nov 2010, 02:00 PM
Thanks for solution, but unfortunnately, my RadGrid's OnGridCreated event is not firing.
Structure of my Grid:
Structure of my Grid:
<
telerik:RadGrid
runat
=
"server"
ID
=
"radGrid1"
AllowMultiRowEdit
=
"True"
EditMode
=
"InPlace"
OnItemDataBound
=
"radGrid1_ItemDataBound"
OnDetailTableDataBind
=
"radGrid1_DetailTableDataBind"
OnUpdateCommand
=
"radGrid1_ItemUpdate"
OnNeedDataSource
=
"radGrid1_NeedDataSource"
OnItemCreated
=
"radGrid1_ItemCreated"
AutoGenerateColumns
=
"false"
HierarchyLoadMode
=
"Client"
>
<
ClientSettings
AllowGroupExpandCollapse
=
"True"
>
<
ClientEvents
OnGridCreated
=
"CollapseAll"
></
ClientEvents
>
</
ClientSettings
>
<
MasterTableView
DataKeyNames
=
"POZ_ID"
GroupLoadMode
=
"Client"
>
0
Hello Paweł,
Maybe it is firing, but there is an error in the client-side code, and because of this, the CollapseAll function is not executed properly.
Check the sample web site, that I am attaching to this post to see working example with this function attached to OnGridCreated event.
Regards,
Vasil
the Telerik team
Maybe it is firing, but there is an error in the client-side code, and because of this, the CollapseAll function is not executed properly.
Check the sample web site, that I am attaching to this post to see working example with this function attached to OnGridCreated event.
Regards,
Vasil
the Telerik team
Browse the vast support resources we have to jumpstart 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

Paweł
Top achievements
Rank 1
answered on 04 Dec 2010, 04:11 PM
Hello againe,
I've tested your solution and JS is not running properly as well.
I've also noticed in my another example site, that JS buttons used in RadGrid to filter data causes javascript errors in browser.
Tried to reinstall RadControls and MS ASP.NET AJAX, but it didn't change anything.
Please tell me, what could be helpful in that problem.
I've tested your solution and JS is not running properly as well.
I've also noticed in my another example site, that JS buttons used in RadGrid to filter data causes javascript errors in browser.
Tried to reinstall RadControls and MS ASP.NET AJAX, but it didn't change anything.
Please tell me, what could be helpful in that problem.
0
Hello Paweł,
Could you tell me what is the JavaScript error that you get?
Best wishes,
Vasil
the Telerik team
Could you tell me what is the JavaScript error that you get?
Best wishes,
Vasil
the Telerik team
Browse the vast support resources we have to jumpstart 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

Paweł
Top achievements
Rank 1
answered on 12 Dec 2010, 09:28 PM
Hi, actually just nothing happens when grid is Clicked, or it has specified events like OnGridCreated.
Any error I can get is that, when I try to use filtering in RadGrid (and it's only "Object expected").
I'm sure that something in Telerik has crashed, when I've had to reinstall Sharepoint at my server recently, but unfortunatelly I don't really know how to repair it - all other JavaScript & ASP & Sharepoint functions are working.
Any error I can get is that, when I try to use filtering in RadGrid (and it's only "Object expected").
I'm sure that something in Telerik has crashed, when I've had to reinstall Sharepoint at my server recently, but unfortunatelly I don't really know how to repair it - all other JavaScript & ASP & Sharepoint functions are working.
0
Hello Paweł,
I am still not able to replicate the issue. Can you make runnable sample web site that represents the problem? If so, please attach it. You can use Jing to capture a video if you want to show us the exact scenario in witch the problem occurs.
Kind regards,
Vasil
the Telerik team
I am still not able to replicate the issue. Can you make runnable sample web site that represents the problem? If so, please attach it. You can use Jing to capture a video if you want to show us the exact scenario in witch the problem occurs.
Kind regards,
Vasil
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

Paweł
Top achievements
Rank 1
answered on 16 Dec 2010, 02:01 PM
Hi,
Of course I can, but I'm afraid this isn't matter of the code, but it's all about the installation.
The problem exist even in your sample code.
As I said, I've had to reinstall (successfully) Sharepoint + MS ASP.Ajax installation, then reinstalled Telerik RadControls.
It seems that after reinstalling the javascript part of Telerik is not working properly.
(The problem listed in topic actually showed the true problem).
Of course I can, but I'm afraid this isn't matter of the code, but it's all about the installation.
The problem exist even in your sample code.
As I said, I've had to reinstall (successfully) Sharepoint + MS ASP.Ajax installation, then reinstalled Telerik RadControls.
It seems that after reinstalling the javascript part of Telerik is not working properly.
(The problem listed in topic actually showed the true problem).
0
Hi Paweł,
Try to make a sample web site, and use only controls from the ASP.NET AJAX Control Toolkit. In this site do not use any of the RadControls. This way we will know where to search for the problem.
If the controls from Ajax Control Toolkit are not working properly. Then the problem can be misconfiguration of Ajax Framework installation. And if Ajax Control Toolkit works right then the problem can be with RadControls installation and configuration.
Best wishes,
Vasil
the Telerik team
Try to make a sample web site, and use only controls from the ASP.NET AJAX Control Toolkit. In this site do not use any of the RadControls. This way we will know where to search for the problem.
If the controls from Ajax Control Toolkit are not working properly. Then the problem can be misconfiguration of Ajax Framework installation. And if Ajax Control Toolkit works right then the problem can be with RadControls installation and configuration.
Best wishes,
Vasil
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

Paweł
Top achievements
Rank 1
answered on 03 Feb 2011, 11:32 PM
Hello again,
After trying a lot, we've managed that problem is for sure connected with telerik installation - it happened again on the new, fresh instalation of Windows Server, WSS 3.0, and Telerik (without MS AJAX installed).
To remind - "javascript part" of telerik-based components (Grid) is not working properly - some of functions aren't firing. Like automatically collapsing items named in topic, or filters. Only I can get is javascript error "Object expected", so unfortunately it doesn't give any addition information.
I know, that issue is hard and maybe strange, but any help would be appreciated.
Edit: Attaching very simple sample of code, where filtering causes javascript error:
After trying a lot, we've managed that problem is for sure connected with telerik installation - it happened again on the new, fresh instalation of Windows Server, WSS 3.0, and Telerik (without MS AJAX installed).
To remind - "javascript part" of telerik-based components (Grid) is not working properly - some of functions aren't firing. Like automatically collapsing items named in topic, or filters. Only I can get is javascript error "Object expected", so unfortunately it doesn't give any addition information.
I know, that issue is hard and maybe strange, but any help would be appreciated.
Edit: Attaching very simple sample of code, where filtering causes javascript error:
<%@ Page Language="C#" MasterPageFile="~/_layouts/application.master"
Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2010.2.713.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<
script
runat
=
"server"
>
System.Data.SqlClient.SqlConnection sqlcon;
String cmd;
System.Data.SqlClient.SqlDataReader myReader;
System.Data.SqlClient.SqlCommand myCommand;
protected override void OnInit(EventArgs e)
{
string con = "#"; //connection string
SqlDataSource1.ConnectionString = con;
cmd = "select * from Naglowek order by NAG_ID DESC";
SqlDataSource1.SelectCommand = cmd;
}
</
script
>
<
asp:Content
ID
=
"Main"
runat
=
"server"
contentplaceholderid
=
"PlaceHolderMain"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
>
</
asp:ScriptManager
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"radGrid1"
DataSourceID
=
"SqlDataSource1"
AutoGenerateColumns
=
"True"
AllowFilteringByColumn
=
"True"
AllowPaging
=
"true"
AllowSorting
=
"True"
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
AllowIntegratedSecurity
=
"True"
ProviderName
=
"System.Data.SqlClient"
runat
=
"server"
></
asp:SqlDataSource
>
</
asp:Content
>
0
Hello Pawel,
Note that RadControls for ASP.NET AJAX are built on top of MS AJAX Framework. Therefore you need to make sure it is installed. Also, can you specify what is the version of SharePoint you are using.
However, for the Object expected error there might multiple reasons. To further isolate the problem, can you comment out the grid, and on the same paga place ASP:UpdatePanel control with a button in it. Thus we can see if the error comes from the MS AJAX Framework or from RadGrid.
Best wishes,
Iana
the Telerik team
Note that RadControls for ASP.NET AJAX are built on top of MS AJAX Framework. Therefore you need to make sure it is installed. Also, can you specify what is the version of SharePoint you are using.
However, for the Object expected error there might multiple reasons. To further isolate the problem, can you comment out the grid, and on the same paga place ASP:UpdatePanel control with a button in it. Thus we can see if the error comes from the MS AJAX Framework or from RadGrid.
Best wishes,
Iana
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.