Hi Customer,
Your requirement can be achieved by specifying cell edit type as “DropDownEdit”, “NumericEdit”,etc. For your convenience , we have prepared sample and the same can be downloaded from the following link:
We request you to check the following online UG link also:
http://help.syncfusion.com/ug/asp.net%20mvc/grid/default.htm#!documents/celledittype.htm
http://help.syncfusion.com/ug/asp.net%20mvc/grid/default.htm#!documents/databindingsupportfo.htm
Please try this and let us know if you have any queries.
Regards,
Eswari S
[UIHint("MyUserControl")]
public virtual int VersionId { get; set; }
Hi Jeremy,
Thanks for your update.
Your requirement can be achieved InlineFromtemplate mode and EditorFor. Please refer to the following steps:
Step #1 : Set Editmode and editortemplateform
<%=Html.Syncfusion().Grid<EditableOrder>("Grid1")
.Editing( edit=>{
edit.AllowEdit(true)
.AllowNew(true)
.AllowDelete(true);
edit.EditMode(GridEditMode.InlineTemplateForm); // set template mode as inlinetemmplate mode
edit.FormModeEditorTemplate("OrderEditorTemplate"); // set partialview of inline template
edit.PrimaryKey(key => key.Add(p => p.OrderID));
})
%>
Step #2 : [OrderEditotTemplate]
<div class="celldiv" style="height: auto">
<%=Html.EditorFor(m => m.OrderStatus) %> // call EditorFor
</div>
Step #3 : EditableOrder model
[UIHint("DropDownList")]
public IEnumerable<SelectListItem> OrderStatus { get; set; }
public EditableOrder()
{
//Fill the list will all the potential selections.
OrderStatus = new[] {
new SelectListItem() { Value = "1", Text = "Open" },
new SelectListItem() { Value = "2", Text = "Validated" },
new SelectListItem() { Value = "3", Text = "In Progress" },
new SelectListItem() { Value = "4", Text = "Delivered" }
};
}
For your convenience , we have prepared the sample and the same can be downloaded from the following link:
Please try this and let us know if you have any queries.
Regards,
Eswari S
Hi Jeremy,
Thanks for your update.
#1 What about the display format?
We can set display format using data annotation formats. Please refer to the following code snippets:
[DisplayFormat( DataFormatString="{0:dd/MM/yy}")]
public DateTime? OrderDate
{
get;
set;
}
Please find updated sample:
# Also, I see a lot of information being posted to the controller that is not in the method signature of the sample. Is there a GridRequestParams object we can add to the signature to grab the data?
We are just passing grid parameters to PagingParams in post action to process grid operations and maintaining some post action values only.
Please let us know if we misunderstood any of your query so that we can check and update based on that.
Please let us know if you need any further assistance.
Regards,
Eswari S
Hi Jeremy,
Thanks for your update.
Your requirement of changing column display based on column value can be achieved using Template column. Please refer to the following code snippets:
<%=Html.Syncfusion().Grid<EditableOrder>("Grid1")
.Datasource(Model)
.Column(column =>
{
. . . . . .
column.Add(p => p.CustomerID).HeaderText("Customer ID").TemplateColumn(true).TemplateName("template");// set TemplateColumn as true and specify TemplateName as partial view which contains template
})
%>
[template.ascx]
<%if (Model.Verified) {%> // control property changed based on Model- Verified column value
<input type="checkbox" checked="checked" />
<%}%>
<%else{%>
<input type="checkbox" />
<%}%>
Please find the modified sample from the following link:
Could you please try with the above sample and let us know if this is satisfies your requirement or please let us know if we misunderstood any of your query.
Online sample link: http://mvc.syncfusion.com/demos/ui/grid/Templates/ServerMode
Let us know if you need any other further assistance.
Regards,
Eswari S
Hi Jeremy
Currently, we don’t have support for the feature ‘UIHint support inside grid ’ .This has been confirmed as a feature request and it will be available in our future volume releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We do not provide confidential information in general forum. Please create the new incident in DirectTrac for better follow up.
Please let us know if you have any queries.
Regards,
Eswari.S