I have an igGrid with updating feature that has 2 combobox and i validate value of it by write function and call it from validated event. i want to validate two column. so i wrote 2 validate function.
Problem: if i use 2 function on the same time then the first combobox has no any data.
if i remove 1 validate function. it work fine.
please help me!
Thanks you very much!
Hello Cuong,
You're welcome. I'm glad that you were able to resolve your issue.
Best regards,Martin PavlovInfragistics, Inc.
thanks you very much! it works fine with my case.
EditorOptions setting overrides the ComboEditorOptions setting.That's the reason you see this behavior. What you need to do is to keep the EditorOptions configuration, but also adding the combo configuration settings as JSON string like this:
.EditorOptions("dataSource:" + Html.Raw(ViewBag.PricingSource) + ", valueKey: 'ID', textKey: 'Description', mode: 'dropdown', enableCleatButton: true, validatorOptions: {onblur: true, keepFocus: 'once', validated: grdFairPriceSourceValidate}")
Hope this helps,Martin PavlovInfragistics, Inc.
thank you here is my code!
@(Html.Infragistics() _ .Grid(Of TPG.CUSIP.Models.tblMarketPriceT)() _ .ID("grdFairPrice") _ .Width("450") _ .Height("200") _ .AutoGenerateColumns(False) _ .AutoGenerateLayouts(False) _ .RenderCheckboxes(True) _ .EnableUTCDates(True) _ .AutofitLastColumn(True) _ .PrimaryKey("mpintMarketPrice_id") _ .Caption("Fair Price") _ .Columns(Sub(column) column.For(Function(x) x.mpintMarketPrice_id).HeaderText("ID").Hidden(True) column.For(Function(x) x.mpstrCusip).HeaderText("CUSIP").Hidden(True) column.For(Function(x) x.mpdatePricing).HeaderText("Price As Of").DataType("date").Width(120).Format("MM/dd/yyyy") column.For(Function(x) x.mpdblPrice).HeaderText("Fair Price").DataType("float").Format("#,000.00000000") column.For(Function(x) x.mpstrPxSource).HeaderText("Source").DataType("string").FormatterFunction("LookupPricingSource") column.For(Function(x) x.mpintPricingLevel).HeaderText("Pricing Level").FormatterFunction("LookupPricingLevel") End Sub) _ .Features(Sub(features) features.Updating().ColumnSettings(Sub(cs) cs.ColumnSetting().ColumnKey("mpdatePricing").EditorType(ColumnEditorType.DatePicker) _
.EditorOptions("validatorOptions: {onblur: true, keepFocus: 'once', validated: grdFairPriceDateValidate}").Required(True) cs.ColumnSetting().ColumnKey("mpstrCusip").DefaultValue(Model.cpstrCusip) cs.ColumnSetting().ColumnKey("mpstrPxSource").EditorType(ColumnEditorType.Combo).ComboEditorOptions(Sub(o) o.DataSource(ViewBag.PricingSource).ValueKey("ID").TextKey("Description").Mode(ComboMode.DropDown).EnableClearButton(True) End Sub) _ .EditorOptions("validatorOptions: {onblur: true, keepFocus: 'once', validated: grdFairPriceSourceValidate}") cs.ColumnSetting().ColumnKey("mpintPricingLevel").EditorType(ColumnEditorType.Combo).ComboEditorOptions(Sub(s) s.DataSource(ViewBag.PricingLevel).ValueKey("ID").TextKey("Description").Mode(ComboMode.DropDown).EnableClearButton(True) End Sub) cs.ColumnSetting().ColumnKey("mpdblPrice").EditorType(ColumnEditorType.Numeric).EditorOptions("inputMask: '#,000.00000000'") End Sub) End Sub) _ .DataSourceUrl(Url.Action("GetFairPrice", "CUSIP", New With {.sCUSIP = Model.cpstrCusip})) _ .UpdateUrl(Url.Action("FairPriceSaveData", "CUSIP", New With {.id = Model.cpstrCusip})) _ .DataBind() _ .Render())
Problem:
Combobox of column key 'mpstrPxSource' have no data if i used this line code '.EditorOptions("validatorOptions: {onblur: true, keepFocus: 'once', validated: grdFairPriceSourceValidate}").Required(True)'
if i comment out this line. this combobox works fine
Note: here is i have 2 validate function
grdFairPriceDateValidate & grdFairPriceSourceValidate
tthank you very much!
Can you send some sample code for me to investigate.
Thanks in advance,Martin PavlovInfragistics, Inc.