I have tried to set a default value for a number column like this:
pCs.ColumnSetting().ColumnKey("StyleKey").DefaultValue(@Model.Pk); // doesn't works. pCs.ColumnSetting().ColumnKey("StyleKey").DefaultValue(Model.Pk); // doesn't works either.
but that produce error. The only thing that works is:
pCs.ColumnSetting().ColumnKey("StyleKey").DefaultValue(@Model.Pk.ToString()); // this works but I want a number, not string.
but StyleKey is number and that renders a string.
How to set a default number value using razor?
Hello Luis,
Currently the DefaultValue method accepts string as an argument. When tested this scenario on my end I didn't notice any problems in the functionality in the browser.What is the problem that you observe?
Thanks in advance,Martin PavlovInfragistics, Inc.
Hi Martin. In my viewmodel the column StyleKey is a number but I don't know how to pass it using Razor.