Hi,
i've implemented a grid databinded with a LinqToSql datasource through client side service
I followed your documentation on demos.telerik.com or telerik.com/help but the grid displays 11 empty rows. (see attached file)
Steps to reproduce:
Service.asmx:
Service.cs:
My thought was that was not working correctly, because the grid displays 11 empty rows, but i tried to put "
On page load, the get methods are never called. (breakpoints never reached)
I'm probably doing it wrong, but i can't figure what is wrong, any help ?
Thanks.
i've implemented a grid databinded with a LinqToSql datasource through client side service
I followed your documentation on demos.telerik.com or telerik.com/help but the grid displays 11 empty rows. (see attached file)
Steps to reproduce:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
Width
=
"300"
AllowPaging
=
"True"
Skin
=
"Vista"
>
<
MasterTableView
>
<
PagerStyle
AlwaysVisible
=
"true"
/>
<
CommandItemSettings
ShowAddNewRecordButton
=
"false"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"RefTransactionTypeID"
HeaderText
=
"Transaction Type ID"
SortExpression
=
"RefTransactionTypeID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Wording"
HeaderText
=
"Wording"
SortExpression
=
"Wording"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
NoRecordsTemplate
>
There are no records to display
</
NoRecordsTemplate
>
</
MasterTableView
>
<
ClientSettings
EnableRowHoverStyle
=
"true"
>
<
DataBinding
SelectMethod
=
"GetRefTransactions"
SelectCountMethod
=
"GetRefTransactionsCount"
Location
=
"Service.asmx"
SortParameterType
=
"Linq"
FilterParameterType
=
"Linq"
>
</
DataBinding
>
</
ClientSettings
>
</
telerik:RadGrid
>
Service.asmx:
<%@ WebService Language=
"C#"
CodeBehind=
"~/App_Code/Service.cs"
Class=
"Service"
%>
Service.cs:
[DataContract]
public
class
MyRefTransactionType
{
[DataMember]
public
byte
RefTransactionTypeID {
get
;
set
; }
[DataMember]
public
String Wording {
get
;
set
; }
}
[WebService(Namespace =
"http://tempuri.org/"
)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public
class
Service : System.Web.Services.WebService
{
int
number = 1;
[WebMethod(EnableSession =
true
)]
public
List<MyRefTransactionType> GetRefTransactions(
int
startRowIndex,
int
maximumRows, List<GridSortExpression> sortExpression, List<GridFilterExpression> filterExpression)
{
IQueryable LinqData = DAL.getTransactionTypes();
// LinqToSql access layer
GridLinqBindingData data = RadGrid.GetBindingData(LinqData, startRowIndex, maximumRows,
""
,
""
);
var result = data.Data.OfType<DAL.RefTransactionType>().Select(t =>
new
MyRefTransactionType()
{
RefTransactionTypeID = t.TransactionTypeID,
Wording = t.Wording
}).ToList();
number = result.Count;
return
result;
}
[WebMethod(EnableSession =
true
)]
public
int
GetRefTransactionsCount()
{
return
number;
}
}
My thought was that was not working correctly, because the grid displays 11 empty rows, but i tried to put "
return new
List<MyRefTransactionType>()
", the grid still displays 11 emptys rows.On page load, the get methods are never called. (breakpoints never reached)
I'm probably doing it wrong, but i can't figure what is wrong, any help ?
Thanks.