Information générale
Catégorie:
The Mere Mortals .NET Framework
Titre:
DataGridView only show certain columns...
Newbie here... OK, thanks to Kevin's help, I have a mmDataGridView that will display the business object entities of a basic Jobs class when the business object is populated.
Now, I want to move on to understanding how to display only certian columns of the business object's entity columns. I do not see a way to choose columns on the dataGridView in the properties window.
For instace, my test form using the GetJobsByCustomer business object method is pulling all columns (about 22 columns) that are in the underlying stored proc in SQL Server. Suppose I only want to display a selected few of those columns in the mmdataGridView.
In my entire app, I can envision needing one Jobs display grid that will show all columns, but I also see needing to display a lightweight version that will show only a few of the columns, and maybe even a different view for certain other cases. So, can I somehow filter the main entity column set as needed, or do I have to build each of my lightweight column sets?
Maintaining multiple entity sets just to deal with columns, seems like a lot of extra work at the stored proc level.
Here's the code in my command button that re-builds the Job entity set based on the selected customer in the mmComboBox.
private void mmGetJobsCommandButton_Click(object sender, EventArgs e)
{
this.oJobs.GetJobsByCust(this.mmComboBox1.SelectedValue.ToString());
}
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement