How do I read the alert time left from EcoNewsControl.EcoNewsControl from the program itself. It is being rendered properly on screen but all attempts to read it from code are failing. Primary Indicator object is not being cached for some reason and when I access it via ChartControl.Controls array, I do get access to a valid object from which I am able to drill down all the way to a Cell but unable to read its value.
On the control, it states that it developed by tradingstudies.com. Browsing for that URL is now redirects me to to Ninja homepage. I have attempted reading
In my last attempt, I added following property. All prior statements that worked are commented because I actually want the Time left value.
public String TimeLeftString
{
get {
try
{
//return newsList.ToString(); // [B]Works [/B]returns class name
//return newsList.Rows.Count.ToString(); // [B]Works[/B]; returns 63
//return newsList.Rows[0].Cells.Count.ToString(); // [B]Works [/B]returns 8
//return newsList.Rows[0].Cells[7].ToString(); // [B]Works [/B]; returns class name
[COLOR="Red"]return newsList.Rows[0].Cells[7].Value.ToString(); // FAILS![/COLOR]
}
catch(Exception e)
{
// All except the last return statement work
// Last return statement throws following exception.
//System.NullReferenceException: Object reference not set to an instance of an object.
// at EcoNewsControl.EcoNewsControl.get_TimeLeftString()
return e.ToString();
}
}
}

Comment