An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
if (((DataGridTextColumn)dgc).DefaultFont == string.Empty)
{
}
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am in the process of writing my own controls to replace 3rd party controls (paid) and am currently doing fonts. I have added a property DefaultFont to the DataGridTextColumn
public class DataGridTextColumn : DataGridColumn
{
public string Text { get; set; }
public string StringFormat { get; set; }
public string DefaultFont { get; set; }
}
Now when I attempt to access this property I get a not found error in the following code:
if ((DataGridTextColumn)dgc.DefaultFont == string.Empty)
{
}
Now for some reason the property does not show and it gets even stranger. I put the following lines of code in and they have no errors (this site really needs fixing as not all copy/paste works the same way).
DataGridTextColumn dg = (DataGridTextColumn)dgc;
var x = dg.DefaultFont;
This is very confusing as one simply does not set a variable for later use.
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Answer accepted by question author
if (((DataGridTextColumn)dgc).DefaultFont == string.Empty)
{
}