Hi,
I am setting this in C# in an MVC3 View.
The grid however refuses to accept it. no error but the grid always starts editing after 1 click.
Regards
Graham
@(Html.Infragistics().Grid<CRUD1.Models.Site>()
.ID("SiteGrid")
.AutoGenerateColumns(false)
.PrimaryKey("Id")
.Columns(column =>
{
column.For(x => x.Id).DataType("number").HeaderText("Id");
column.For(x => x.SBII_SiteId).DataType("number").HeaderText("Site Id");
column.For(x => x.SiteName).DataType("string").HeaderText("Site Name");
column.For(x => x.Client_SiteId).DataType("string").HeaderText("Client Site Id");
column.For(x => x.Address1).DataType("string").HeaderText("Address 1");
column.For(x => x.Address2).DataType("string").HeaderText("Address 2");
column.For(x => x.Address3).DataType("string").HeaderText("Address 3");
column.For(x => x.PostCode).DataType("string").HeaderText("PostCode");
column.For(x => x.Phone).DataType("string").HeaderText("Phone");
column.For(x => x.EARegistration).DataType("string").HeaderText("EAReg");
column.For(x => x.IpAddress).DataType("string").HeaderText("Site Ip");
column.For(x => x.SBII_IpAddress).DataType("string").HeaderText("Controller Ip");
column.For(x => x.Enabled).DataType("bool").HeaderText("Enabled");
})
.Features(feature =>
feature.Updating().EditMode(GridEditMode.Row).StartEditTriggers(GridStartEditTriggers.DblClick);
feature.Updating().ColumnSettings(settings =>
settings.ColumnSetting().ColumnKey("Id").ReadOnly(true);
settings.ColumnSetting().ColumnKey("SiteId").EditorType(ColumnEditorType.Numeric).Required(true).Validation(false);
settings.ColumnSetting().ColumnKey("SiteName").EditorType(ColumnEditorType.Text).Required(true).Validation(true);
settings.ColumnSetting().ColumnKey("Address1").EditorType(ColumnEditorType.Text).Required(false).Validation(true);
settings.ColumnSetting().ColumnKey("Address2").EditorType(ColumnEditorType.Text).Required(false).Validation(true);
settings.ColumnSetting().ColumnKey("Address3").EditorType(ColumnEditorType.Text).Required(false).Validation(true);
settings.ColumnSetting().ColumnKey("PostCode").EditorType(ColumnEditorType.Text).Required(false).Validation(true);
settings.ColumnSetting().ColumnKey("Phone").EditorType(ColumnEditorType.Text).Required(false).Validation(true);
settings.ColumnSetting().ColumnKey("EARegistration").EditorType(ColumnEditorType.Text).Required(false).Validation(true);
settings.ColumnSetting().ColumnKey("Client_SiteId").EditorType(ColumnEditorType.Text).Required(false).Validation(false);
settings.ColumnSetting().ColumnKey("IpAddress").EditorType(ColumnEditorType.Text).Required(false).Validation(false);
settings.ColumnSetting().ColumnKey("SBII_IpAddress").EditorType(ColumnEditorType.Text).Required(false).Validation(false);
settings.ColumnSetting().ColumnKey("Enabled").ReadOnly(true);
});
.DataSourceUrl(Url.Action("Details", "Site"))
.UpdateUrl(Url.Action("Update", "Site"))
//MUST remember to do these !!
.DataBind()
.Render()
)
Hi Graham,
I tested features.Updating().StartEditTriggers(GridStartEditTriggers.DblClick)... and it worked correctly. I also tested online sample (please try to test it too)http://samples.infragistics.com/jquery/grid/row-editing-api'
which has setter for DblClick and that also worked as expected.That is possible that in your application those settings for some reason do not have effect or they are overriden by some other logic.
Please run your sample, open source of generated html (in browser) and try to find string "startEditTriggers:". That should be located somewhere within igGrid({ ....... }); block and it should appear asstartEditTriggers: 'DblClick'
Found the problem !!
I later tried to add EnableAddRow(false), and that too failed !!.
The PROBLEM is that the grid allows me to use the code as follows in my cshtml file :
feature.Updating().EnableAddRow(false); feature.Updating(). EditMode(GridEditMode.Row).StartEditTriggers(GridStartEditTriggers.DblClick); feature.ColumnSettings(settings => { etc. etc.
feature.Updating().EnableAddRow(false);
feature.Updating().
EditMode(GridEditMode.Row).StartEditTriggers(GridStartEditTriggers.DblClick);
feature.ColumnSettings(settings =>
{ etc. etc.
It then proceeds to generate js with multiple entries for 'Updating' - BUT it only seems to actually accept the last one :-O.
If I combine ALL of the above into a single feature setting - it works and accepts ALL relevant settings.
This has to be a bug in the grid - as it accepts the multiple { Updating xxx } code but refuses to accept them.
Hope this helps you fix this issue ;-)).