Posted 29 May 2023, 4:07 am EST
- Updated 29 May 2023, 4:15 am EST
Hi, Sorry for my initial post lacking for lacking so little detail.
My code is VS 2023 C#, the C1 control component is C1.Win.C1InputPanel.4.5.2 on Winforms.
I am currently just started a demo for your software
The error I am getting from my code is:
Error CS1656 Cannot assign to ‘Contains’ because it is a ‘method group’
I am struggling to find a suitable solution, I am trying to limit the row I display in my form too one which only contain a specific text string “UK 100 - Rolling Cash”
I have included a screenshot of the form I have coded.
Here is a small sample of my code if you require a larger one or further information please let me know
Many Thanks.
[code] public bool loadOrder()
{
try
{
dataTable = new DataTable();
// Add columns to the DataTable
dataTable.Columns.Add("Market", typeof(string));
dataTable.Columns.Add("Amount", typeof(string));
dataTable.Columns.Add("Stop", typeof(string));
dataTable.Columns.Add("Limit", typeof(string));
dataTable.Columns.Add("Hedging", typeof(string));
dataTable.Columns.Add("IF.D Stop", typeof(string));
dataTable.Columns.Add("IF.D Limit", typeof(string));
dataTable.Columns.Add("Period", typeof(string));
dataTable.Columns.Add("Current Price", typeof(string));
dataTable.Columns.Add("Order Placed", typeof(string));
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "order.html");
HtmlAgilityPack.HtmlDocument document = new HtmlAgilityPack.HtmlDocument();
document.Load(filePath, Encoding.UTF8);
var tbodyNodes = document.DocumentNode.SelectNodes("//tbody[@class='yui-dt-data']");
if (tbodyNodes != null && tbodyNodes.Count > 1)
{
HtmlNode secondTbodyNode = tbodyNodes[2];
// Loop through the rows in the tbody
if (secondTbodyNode.InnerLength > 0)
{
foreach (HtmlNode row in secondTbodyNode.SelectNodes("tr"))
{
if (dataTable.Rows = ("UK 100 - Rolling Cash"))
{
HtmlNodeCollection cells = row.SelectNodes("td");
dataTable.Rows.Add(cells[0].InnerText, cells[1].InnerText, cells[2].InnerText, cells[3].InnerText, cells[4].InnerText, cells[5].InnerText, cells[6].InnerText, cells[7].InnerText, cells[8].InnerText, cells[9].InnerText);
}
}
}
else
{
dataTable.Rows.Add("", "", "", "", "", "", "", "");
}
}
OpenOrder.DataSource = dataTable;
return true;
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
return false;
}
}[/code]
