I am a beginner programmer and have to use Entity Framework for a project,
I am using the following code to populate a Datagrid
:
private void Inscription_Load(object sender, EventArgs e)
{
using (receptionEntities oProxy = new receptionEntities())
{
List<P_ShowPotentialReception_Result> oQuery =
oProxy.P_ShowPotentialReception(MainForm.seq_no).ToList();
foreach (P_ShowPotentialReception_Result objrecep in oQuery)
{
Console.WriteLine(objrecep.Rec_seq_no);
}
dataGrid3.DataSource = oQuery.ToList();
}
}
The console.writeline
is just there to check that the values have been gone through.
Two questions :
1) Is there a way to hide the columns I dont want to be shown for the user in this grid?
2) Is there a way to customize the background colors of a row depending on one of the columns info when you use Entity Framework to populate?