3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 25 Sep 2013, 07:35 AM
Hi Varun,
The mentioned behavior is not expected.Make sure you are binding the grid using Advanced Data-binding (Using NeedDataSource Event). Below is a sample code snippet that i tried,it works fine at my end.Can you provide your full code if this sample didn't help.
ASPX:
C#:
Thanks,
Princy
The mentioned behavior is not expected.Make sure you are binding the grid using Advanced Data-binding (Using NeedDataSource Event). Below is a sample code snippet that i tried,it works fine at my end.Can you provide your full code if this sample didn't help.
ASPX:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AutoGenerateColumns
=
"false"
GridLines
=
"None"
AllowPaging
=
"true"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
>
<
MasterTableView
DataKeyNames
=
"OrderID"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"OrderID"
DataField
=
"OrderID"
HeaderText
=
"OrderID"
/>
<
telerik:GridBoundColumn
DataField
=
"ShipCity"
HeaderText
=
"ShipCity"
UniqueName
=
"ShipCity"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
Scrolling-AllowScroll
=
"true"
>
</
ClientSettings
>
</
telerik:RadGrid
>
<
br
/>
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
AutoGenerateColumns
=
"false"
GridLines
=
"None"
AllowPaging
=
"true"
OnNeedDataSource
=
"RadGrid2_NeedDataSource"
>
<
MasterTableView
DataKeyNames
=
"OrderID"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"OrderID"
DataField
=
"OrderID"
HeaderText
=
"OrderID"
/>
<
telerik:GridBoundColumn
DataField
=
"UnitPrice"
HeaderText
=
"UnitPrice"
UniqueName
=
"UnitPrice"
/>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
Scrolling-AllowScroll
=
"true"
>
</
ClientSettings
>
</
telerik:RadGrid
>
C#:
public
DataTable GetDataTable(
string
query)
{
String ConnString = ConfigurationManager.ConnectionStrings[
"Northwind_newConnectionString3"
].ConnectionString;
SqlConnection conn =
new
SqlConnection(ConnString);
SqlDataAdapter adapter =
new
SqlDataAdapter();
adapter.SelectCommand =
new
SqlCommand(query, conn);
DataTable myDataTable =
new
DataTable();
conn.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
conn.Close();
}
return
myDataTable;
}
protected
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = GetDataTable(
"SELECT OrderID, ShipCity FROM Orders"
);
}
protected
void
RadGrid2_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = GetDataTable(
"SELECT OrderID, UnitPrice FROM Order Details"
);
}
Thanks,
Princy
0
Laxman
Top achievements
Rank 1
answered on 15 Nov 2013, 06:28 AM
Hi,
I am also facing same problem. I created a sample grid page in telerik 2012.2.724.35 trail version then it works fine with pagesize selection position.
But when I update telerik with new version 2013.3.1015.40 licence , I am facing problem with select page index also.
Pls find the link for more info and help me to sove it.
TQ
0
Hi,
I tried replicating the issue you are facing, however I was unable to. I tried different versions of RadControls and different browsers - the result was the same.
I am attaching a sample project that is working as expected on my end. Give it a try and let me know if it is working on your end as well. Could you tell me what should be modified in the project in order for the problem to be observed? This would enable us to replicate the issue locally and examine the cause.
Regards,
Viktor Tachev
Telerik
I tried replicating the issue you are facing, however I was unable to. I tried different versions of RadControls and different browsers - the result was the same.
I am attaching a sample project that is working as expected on my end. Give it a try and let me know if it is working on your end as well. Could you tell me what should be modified in the project in order for the problem to be observed? This would enable us to replicate the issue locally and examine the cause.
Regards,
Viktor Tachev
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.