I have the view :
<%= Html.Grid(Model.data).Columns(column => {
column.For(x => x.results)
.Action(item => Html.ActionLink(item.results,"Edit").ToString(),
item => Html.TextBox("result",item.results).ToString(),
item => (Model.data == item))
.Named("Results");
column.For(x => x.refId)
.Named("Reference ID");
column.For(x => x.fileLocation)
.Named("File Location");
})
.Attributes(style => "width:100%", border => 1)
And the controller looks like:
public ActionResult Index()
{
// IEnumerable<TranslationResults> results;
StringSearchResultsModelIndex modelInstance = new StringSearchResultsModelIndex();
modelInstance.getData();
return View("SearchGUIString", modelInstance);
}
the data:
public class StringSearchResultsModelIndex : IStringSearchResultsModelIndex
{
private IEnumerable<StringSearchResultModel> m_data;
private string id;
public IEnumerable<StringSearchResultModel> getData()
{
List<StringSearchResultModel> models = new List<StringSearchResultModel>();
StringSearchResultModel _sModel = new StringSearchResultModel();
for (int i = 1; i < 11; i++)
{
_sModel = new StringSearchResultModel();
_sModel.fileLocation = "Location" + i;
_sModel.refId = "refID" + i;
_sModel.results = "results" + i;
models.Add(_sModel);
}
m_data = models;
return models;
}
public IEnumerable<StringSearchResultModel> data { get { return m_data; } set { m_data = value; } }
public string SelectedRowID {get {return id ; } set { id = value; } }
}
when I click the edit button from ActionLink, I am directed to /search/Edit page, I understand that I need to have some code in controller for //search/Edit but I am not getting the text box where I can edit the text in result cell. I am new to MVC can anyone direct me where I am should be going from here, any suggestions?