c# - data-binding, IDataErrorInfo and complex properties naming -


lets have myclass.cs in have property called name, have viewmodel inherits idataerrorinfo, created multible instances of myclass in viewmodel , added them observablecollection< myclass> , collection itemssource of datagrid , , surly 1 of it's datagridtextcolumn bound name property, wrks in following xaml

<datagridtextcolumn binding="{binding  name}" header="name" isreadonly="true" /> 

all , need supply column name idataerrorinfo, follows

string idataerrorinfo.this[string columnname]     {                  {             string error = string.empty;            switch (columnname)            {                case "whattoputhere":                    error = validatename();                    return error;                default:                    throw new applicationexception("wrong property name being validated");            }         }     } 

the problem , don't have "name" property here in viewmodel , there on myclass.cs , don't know supply idataerrorinfo column name , tried name , myclass.name both didn't work out , suggestions ?? in advance

the name of property. in case it's name


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -