I'm following the documentation here:
https://docs.kentico.com/display/K82/Reference+-+UniGrid+definition#Reference-UniGriddefinition-Settingparametersforcustomcolumnfilters
This is from my UniGrid defition:
<column source="MediaTypeID" caption="Type" externalsourcename="#transform: wvo.mediatype.mediatypelabel" wrap="false"> <filter type="custom" path="~/Filters/MediaTypeFilter.ascx" format="[{0}] IN (SELECT MediaTypeID FROM WVO_MediaType WHERE MediaTypeLabel {1} {2})"> <Parameters> <filterparameter name="Column" value="MediaTypeID" /> </Parameters> </filter> </column>
My filter (MediaTypeFilter.ascx) implements ISimpleDataContainer per the instructions:
/// <summary> /// Gets or sets the value of the column. /// </summary> /// <param name="columnName">Name of the column.</param> public object this[string columnName] { get { return GetValue(columnName); } set { SetValue(columnName, value); } } /// <summary> /// Returns value of column. /// </summary> /// <param name="columnName">Column name</param> public object GetValue(string columnName) { switch (columnName.ToLower()) { case "column": return this.Column; } return null; } /// <summary> /// Sets value of column. /// </summary> /// <param name="columnName">Column name</param> /// <param name="value">Column value</param> public bool SetValue(string columnName, object value) { EventLogProvider.LogInformation("SetValue", "SetValue", "AM I HERE? ::: " + columnName + " ::: " + value); switch (columnName.ToLower()) { case "column": this.Column = ValidationHelper.GetString(value, ""); return true; } return false; }
... but that SetValue method never gets called. What am I missing?
Thanks!
Have you tried to set the setvalue function on the page load? Does it hit then?
Please, sign in to be able to submit a new answer.