I'm using DataGridViewButtonColumn already. But only gets one type of button. Would like one that says "Buy toy" and one "Play" so I can target each one.
This is what my code for creating the "Buy button" looks like, which creates the first image in #1.
DataTable dt = new DataTable()...
Is it possible to have custom buttons on different rows using Datagridview? I manage to have each button in two separate columns. But not in the same one.
How can this be done? I can post the current code I'm using if needed.
Sorry about that. Difficult to keep names apart as a newbie. Thanks for pointing me in the right direction though.
Yes it's the cellContentClick event. I don't think I follow completely though. I searched the data that's being retrived from the sender but couldn't find any object correlating to...
The outcome I manage to put togheter was this which works fine.
I have a button column in a datagrid. The datagrid is printing out a list of animals. When clicking the button column I would like to get the corresponding animal object.
I found some interesting data that's being sent but this is as a string like: Doggy, Bone, Large, Button.
What I'm looking...
I'm trying to get data from two lists/sources to populate my datagrid view. I manage to print all fields for an animal but the list of Toys. How can I proceed with this one? What's the correct route?
This is what my code looks like:
I'm trying to set a color for the DefaulyCellStyle property but in only color the first cell for some reason. Any ideas?
// Set the selection background color for all the cells.
dataGridView1.DefaultCellStyle.SelectionBackColor = Color.White...
I've added an propery in a class which I now trying to reach from my Data Grid View. It doesn't show up however. I've tried to add new Data Sources, removed the DataGridView and added a new one but that doesn't seem to do anything.