剣道グリッドとフィールドのビューに値を返す際に問題があります。
以前は部分ビューに剣道グリッドしかなかったので、以下のコードを使用してグリッドの値を返しました。
public virtual ActionResult GetValues(long Id1, [DataSourceRequest]DataSourceRequest request)
{
return Json(ViewModel.List<Another_View_Model>.ToDataSourceResult(request));
}
私のビューモデルの構造は次のとおりです
ViewModel
{
public long Id { get; set; }
public List<Another_View_Model> Another_View_Model { get; set; }
}
しかし今、同じ部分ビューに剣道のテキストボックス、チェックボックスを追加していて、グリッド値を返しながらそれらのフィールドにもサーバー値を返したいと考えています。
私のビューモデルの構造は次のとおりです
ViewModel
{
public long Id { get; set; }
public List<Another_View_Model> Another_View_Model { get; set; }
public string textboxField { get; set; }
}
コントローラーで次の変更を行っていますが、テキスト ボックス フィールドの値がビューに戻りません。
public virtual PartialViewResult GetValues(long Id1)
{
return PartialView("_PartialView", ViewModel);
}
誰でも私が間違っているところを指摘してもらえますか、または同じモデル内でグリッドと剣道要素の両方の結果を同時に返すより良い方法がありますか?
私のビュー構造は次のとおりです。
@model ViewModel
@(Html.Kendo().TextBoxFor(p => p.textboxField)
.Name("TextBox")
)
@(Html.Kendo().Grid<Another_View_Model>()
.Name("KendoGrid")
これに関する任意の助けをいただければ幸いです。前もって感謝します!!