c# - How to check to which DataColumn a DataGridTextColumn is bound to -
i check datacolumn
datagridtextcolumn
bound to.
i trying like:
private void kblmeoravprdatagrid_preparingcellforedit(object sender, datagridpreparingcellforediteventargs e) { if ((e.column datagridtextcolumn).binding.path == "dbfieldname") {
you should first check value isn't null.
var datagridtextcolumn = e.column datagridtextcolumn; if (datagridtextcolumn != null) // if not null column datagridtextcolumn { //working }
Comments
Post a Comment