开发者

Datagridview ability to modify data or other alternates

I am using a SQlite database connected to datagridview control. Now, I am able to display the database in the Winforms application. My next requirements are to read the items in the datagr开发者_开发百科idview and then group different rows together based on whats in it.. So, if there are two rows matched by an alarm id, I want both the rows to be next to each other with some id flag or colorcode. Is it possible to do this... Ideally would like the row to get listed in a tree like structure , like how windows explorer handles directories... Is this possible or anything close to is possible?

Thanks..


Possible is a loaded question. In Hollywood, anything is possible.

If you mean "is it possible for .NET to automagically group things for me so I don't have to code anything", the answer is no. There are third party controls, however, that can do an amount of nesting, if you feed them the data and give them the nesting rules. They are not free, but can save you a lot of time.

Sans buying, as long as you can figure out how to sort in the proper order for your grouping, you can easily make them nest in a tree control. You can also have a grid in a grid and do some really neat nesting.

If you merely want the rows next to each other and use alternative colors each time an alarm changes, you can do this. Sort the data first and then you can bind to a grid (as an example, not THE example) and alter background color using the Row Binding event. Even with a treeview, you can intercept the individual binding events.

Does any of this make sense? If not, I suggest reading up on the controls in question, as that will lead you to an answer.

The first place to start is figure out the order for the data so you can group properly.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜