Hi,
I want to send data from the Kendo Grid to a database. however, i dont want to send it directly, i want it to go through a c# method I have, before sending.
I got it to the point where it calls the c# code inside of the controller. However, it isn't sending the data I have synced to the button.
here's the code.
I want to send data from the Kendo Grid to a database. however, i dont want to send it directly, i want it to go through a c# method I have, before sending.
I got it to the point where it calls the c# code inside of the controller. However, it isn't sending the data I have synced to the button.
here's the code.
@(Html.Kendo().Button()
.Name(
"SentItems"
)
.Content(
"Send Products"
)
.Events(e => e.Click(
"SendData"
)))
function
SendData()
{
alert(
'Sending Data'
);
var
gridData = $(
"#PLAGridMain"
).data(
"kendoGrid"
);
var
text =
"Object properties are: "
;
$.ajax({
url:
'/Home/sendRows'
,
cache:
false
,
type:
'POST'
,
contentType:
'application/json; charset=utf-8'
,
data: JSON.stringify($(
"#PLAGridMain"
).data(
"kendoGrid"
).dataSource),
complete:
function
()
{
alert(
"success: "
);
}
})
}
C
# in HomeController:
[HttpPost]
public void sendRows(Grid<string>)
{
//[DataSourceRequest] DataSourceRequest dataSourceRequest
//send each row to the google MCC.
string PLA = string.Empty;
}