Note that there are some explanatory texts on larger screens.

plurals
  1. PODataGrid doesnt show all properties of an object which implement interface
    text
    copied!<p>I have an interface defined as below.</p> <pre><code>public interface IDraw { int DrawID {get;set;}, int Num1 {get;set;} } </code></pre> <p>and I have 2 classes which implement the interface </p> <pre><code>public class DrawOne:IDraw { public int DrawID {get; set;} public int Num1 { get; set;} public int Num2 { get ; set;} } public class DrawOne : IDraw { public int DrawID {get; set;} public int Num1 { get; set;} public int Num2 { get ; set;} public int Num3 { get; set;} } </code></pre> <p>And I have another interface which defines a method as below</p> <pre><code> public interface IDrawType { IDraw GetData(); } </code></pre> <p>there is another class which implements this interface.</p> <pre><code>public class MyDrawTypeOne : IDrawType { public IDraw GetData() { DrawOne drawOne = new DrawOne(); drawOne.DrawID = 1001; drawOne.Num1 = 8; drawOne.Num2 = 9; return drawOne; } } </code></pre> <p>I am implementing the above objects' definition as below</p> <pre><code>public class ImplementationClass { public void ButtonClick() { List&lt;IDraw&gt; listData = new List&lt;IDraw&gt;(); MyDrawTypeOne drawOne = new MyDrawTypeOne(); for(int i=0; i&lt;10; i++) { IDraw data = drawOne.GetDrawData(); listData.Add(data); } gridDraw.DataSource = listData; } } </code></pre> <p>The problem I have here is , the data grid only display DrawID and Num1. I am not able to see the Num2 in the data grid. Is there anything I am missing here? </p> <p>Any help would be much appreciated.</p> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload