Hi @Lakshman Bana ,
You get 7 in item count, it is just the number of list items. However, it doesn't mean the item id is 1,2,3,4,5,6,7. The item id could be 1,2,3,4,7,8,9 or else.
You should use the below instead:
ListItemCollection listItems= list.GetItems(CamlQuery.CreateAllItemsQuery());
ctx.Load(listItems);
ctx.ExecuteQuery();
foreach(ListItem ic in listItems)
{
Console.WriteLine("{0}, {1}", ic["Title"], ic["ItemChildCount"]);
}
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.