I have a completely code-behind solution with a RadAjaxManager and Radgrid. Unfortunately, the RadAjaxManager disables the Page Size drop down list of the RadGrid, unless I have otherwise interacted with the grid already. For example, if I move from one page to another the Page Size drop down list will then be enabled. Does anyone have any thoughts?
I have commented out the RadAjaxManager and put the grid in a RadAjaxPanel, and it appears to function properly.
Thanks,
Mark
I have commented out the RadAjaxManager and put the grid in a RadAjaxPanel, and it appears to function properly.
Thanks,
Mark
6 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 11 Oct 2013, 04:21 AM
Hi Mark,
Please try the sample code snippet which works fine at my end.If this doesn't help,please provide your full code snippet.
ASPX:
C#:
Thanks,
Princy
Please try the sample code snippet which works fine at my end.If this doesn't help,please provide your full code snippet.
ASPX:
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
</
telerik:RadAjaxManager
>
<
asp:PlaceHolder
ID
=
"PlaceHolder1"
runat
=
"server"
></
asp:PlaceHolder
>
C#:
RadGrid RadGrid1;
protected
void
Page_Load(
object
sender, EventArgs e)
{
RadAjaxManager1.AjaxSettings.AddAjaxSetting(RadGrid1, PlaceHolder1,
null
);
}
protected
void
Page_Init(
object
source, System.EventArgs e)
{
Loadprogramaticgrid();
RadGrid1.NeedDataSource +=
new
GridNeedDataSourceEventHandler(RadGrid1_NeedDataSource);
}
private
void
Loadprogramaticgrid()
{
RadGrid1 =
new
RadGrid();
RadGrid1.ID =
"RadGrid1"
;
RadGrid1.MasterTableView.DataKeyNames =
new
string
[] {
"OrderID"
};
RadGrid1.Skin =
"Default"
;
RadGrid1.Width = Unit.Percentage(100);
RadGrid1.AutoGenerateColumns =
false
;
RadGrid1.AllowPaging =
true
;
//Add columns
GridBoundColumn boundColumn;
boundColumn =
new
GridBoundColumn();
RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField =
"CustomerID"
;
boundColumn.HeaderText =
"CustomerID"
;
boundColumn =
new
GridBoundColumn();
RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField =
"ShipCity"
;
boundColumn.HeaderText =
"ShipCity"
;
boundColumn =
new
GridBoundColumn();
RadGrid1.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField =
"ShipVia"
;
boundColumn.HeaderText =
"ShipVia"
;
this
.PlaceHolder1.Controls.Add(RadGrid1);
}
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = loaddata(
"SELECT OrderID,CustomerID,ShipCity,ShipVia FROM Orders"
);
}
Thanks,
Princy
0
0
Hi Mark,
Could you please confirm that you are trying to set an AjaxManager into a SharePoint project. If that is correct you could try to set it as my colleague Tsvetoslav already demonstrated. Also you could try using the approach from the following help article. Additionally you could try disabling the ajax and check whether the issue remains. It would be best if you could replicate the issue in a small runnable sample in order to observe it locally.
Regards,
Kostadin
Telerik
Could you please confirm that you are trying to set an AjaxManager into a SharePoint project. If that is correct you could try to set it as my colleague Tsvetoslav already demonstrated. Also you could try using the approach from the following help article. Additionally you could try disabling the ajax and check whether the issue remains. It would be best if you could replicate the issue in a small runnable sample in order to observe it locally.
Regards,
Kostadin
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 the blog feed now.
0
Mark
Top achievements
Rank 1
answered on 15 Oct 2013, 06:41 PM
Hi Kostadin,
Yes, this is in a SharePoint Web Part project. I have reviewed Tsvetslav's code, and I actually used his example from this link in my own. The problem does not persist when I disable Ajax. In fact it works fine when I place the RadGrid in an AjaxPanel, which strikes me as odd. I would welcome any suggestions enough though the AjaxPanel seems to work just fine. Right now my goal is in improving the RadGrid's performance.
Thanks,
Mark
Yes, this is in a SharePoint Web Part project. I have reviewed Tsvetslav's code, and I actually used his example from this link in my own. The problem does not persist when I disable Ajax. In fact it works fine when I place the RadGrid in an AjaxPanel, which strikes me as odd. I would welcome any suggestions enough though the AjaxPanel seems to work just fine. Right now my goal is in improving the RadGrid's performance.
Thanks,
Mark
0
Mark
Top achievements
Rank 1
answered on 15 Oct 2013, 06:55 PM
Here is an interesting observation: Once the User interacts with the grid, using AjaxManager, the Page Size DDL is not active. For example, when the page first loads, the Page Size DDL will be unusable, but once the Users clicks on one of the Page Arrows it will now function properly.
0
Hi Mark,
In this case could you please provide your code declaration in order to observe the issue further. It would be best if you could isolate the issue in a small sample and provide it to us in order to investigate it locally.
Regards,
Kostadin
Telerik
In this case could you please provide your code declaration in order to observe the issue further. It would be best if you could isolate the issue in a small sample and provide it to us in order to investigate it locally.
Regards,
Kostadin
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 the blog feed now.