Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
50
@(Html.Infragistics().Grid () DatePicker Issue
posted

Hi Team,

I am looking for configuring the DatePicker in IgGird.

@(Html.Infragistics().Grid<ViewModel>()
.ID("myGrid")
.PrimaryKey("keyField")
.Height("100%")
.Columns(column =>
{

 column.For(x => x.DEMAND_DT).HeaderText("DEMAND_DT" + "*").DataType("date").Width("10%").Hidden(false);

}

.Width("100%")
.ResponseDataKey("Data.data")
.EnableUTCDates(false)
.AggregateTransactions(true)
.Features(features =>
{

  settings.ColumnSetting().ColumnKey("DEMAND_DT").AllowFiltering(true).FilterCondition("startsWith").AllowFiltering(true);

}).

.AddClientEvent("dropDownOpening", "method1");
features.Selection().Mode(SelectionMode.Row).MultipleSelection(true).Persist(false);
features.Sorting().Mode(SortingMode.Single).Type(OpType.Remote).Mode(SortingMode.Single).SortUrlKey("sort");
features.Updating().WrapAround(false).EditMode(GridEditMode.Row).EnableAddRow(false).EnableDeleteRow(false).ShowDoneCancelButtons(false)
.ColumnSettings(cs =>
{

   cs.ColumnSetting().ColumnKey("DEMAND_DT").Required(true).ReadOnly(false).EditorType(ColumnEditorType.DatePicker).Validation(true)EditorOptions("minValue: new Date(1955, 1, 19), required: true"); 

})

  .AddClientEvent("editCellStarting", "editCellStartingEvent")

.TabIndex(-1)
.AddClientEvent("cellClick", "cellClickEvent")
.AutoGenerateColumns(false)
.AutoGenerateLayouts(false)
.AutoCommit(false)
.RenderCheckboxes(true)
.UpdateUrl(Url.Action("SaveData", "MYCONTROLLER"))
.DataSourceUrl(Url.Action("GetData", "MYCONTROLLER"))
.Render())

BUT when view is rendering then  error occur  "This option can not be set runtime."

Parents
No Data
Reply
  • 275
    Offline posted

    Hello Siddharth,

    I noticed that there's missing point just before the "EditorOptions("minValue: new Date(1955, 1, 19), required: true");" text, but I assume this is a typo from copy/pasting your code?

    I tried configuring the igDatePicker inside the igGrid in a similar way for a date column and Updating feature and I didn't get any errors.
    Could it be that you are setting some kind of options inside those bound events that are not designed to be settable during runtime, but only when the grid is initialized.
    The igDatePicker in particular has some options that are not settable during runtime, but it could be other options that are not related to the igDatePicker.

    Could you provide the full error that your are getting or possibly a small isolated sample where the issue is reproducible.

    Regards,
    Svetoslav Krastev,
    Infragistics

Children
No Data