wpf datagrid: write value in textbox column -


i have datagrid columns. binded list of objects. 1 of column text column: need "validation" column, infact want that, each row, value of cell "ok" or "not ok", based on values present in other cells. don't know how write string cell datagrid. suggestion?

edit: following class describes objects of datagrid

public class bracketproperty {     [xmlattribute]     public int index { get; set; }     public brackettype type { get; set;}     public list<bracketpoint> bracketpointslist;     [xmlignore]     public string ispointselectionended { get; set; } } 

edit2: tells me line of code not good

this.bracketsdatagrid.itemssource = this.currentpropertytoshow.sides[this.sideindex - 1].brackets; 

where brackets defined as

 public observablecollection<bracketproperty> brackets; 

because not binding...how can change binding?

the easiest way create data type class has public property each column in datagrid. should implement inotifypropertychanged interface in class.

then can have property update in propertychanged handler:

private void yourdatatype_propertychanged(object sender, propertychangedeventargs e) {     if (property1 == "somevalue" && property2 > 0) validationproperty = "ok";     else validationproperty = "not ok"; // add own condition above of course } 

in constructor:

propertychanged += yourdatatype_propertychanged; 

Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -