Reputation: 63
Something happens strange... I have a Receipt.cs class in my project. When i try to bound my datagridview to this class then there is no option of Receipt.cs in Choose Data Source Option.
In my previous project everything works well in visual studio. I couldn't understand why this happens in my new project.
Here is Image, No option for Receipt.cs But my project has Receipt.cs Class
Here is my Receipt.cs Class.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Store_Management_System
{
public class Receipt
{
public int Id { get; set; }
public string ProductName { get; set; }
public double Price { get; set; }
public int Quantity { get; set; }
public string Total { get { return string.Format("{0}$", Price * Quantity); } }
}
}
References in my Project. May be i am missing some reference?
Upvotes: 1
Views: 1552
Reputation: 1
this was left unsolved by people. I just want to share the solution to this.
Upvotes: 0
Reputation: 63
After creating Receipt.cs class, I rebuild the project but build was not successful as there is some little error (But not in Receipt.cs class).
I removed the error and make Successful Build, Then everything goes Fine...!!!
Upvotes: 2
Reputation: 2587
The Class should appear in Object Data Source List after its being compiled. It looks you have not recompiled/build the project containing the Receipt class.
-Thanks
Upvotes: 1