Sign in to follow this  

DatagridView vs TreeView

Recommended Posts

I have a program that scans source code for issues.

Right now it outputs the information to a treegrid view, each main node being the problems name and each subnode being a source file.
When the user clicks on a file a seperate tree view shows information on the file, the problem, and how to fix it.

The only problem is when there are a large amount of problems it seems a little impractical to go through every node and expand each one and read the individual problems.

So I was thinking a better way to do it might possibly be a datagrid view.
I was thinking having the following columns "Issue" "File Name" "Code Snipplet".
This datagrid view would be connected to a dataset.
The only problem I see with this is that I won't have all of the nice icons that I have now associated with the pages.

Overall for my situation which would be the most practical and show the information the best?

I basically am just asking for some opinions on this before modifying all of this code.
Thanks in advance,


Share this post

Link to post
Share on other sites
If you store the image in the DB that you want along with the rest of the data then it is easy.

private void createGraphicsColumn()
Icon treeIcon = new Icon(this.GetType(), "tree.ico");
DataGridViewImageColumn iconColumn = new DataGridViewImageColumn();
iconColumn.Image = treeIcon.ToBitmap();
iconColumn.Name = "Tree";
iconColumn.HeaderText = "Nice tree";
dataGridView1.Columns.Insert(2, iconColumn);

Share this post

Link to post
Share on other sites
It's kind of hard for me to arrive at an opinion on this without knowing anything about what the data is, how it's formatted, how I would typically want to browse it, and so on. I could see use cases where both options make sense, but since I don't know much about your tool, it's hard to think which one might be preferable.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this