943,752 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 14551
  • C# RSS
Oct 3rd, 2007
0

Regarding images in button column of datagridview

Expand Post »
hi all.

Is it possible to display an image in all buttons in a
datagridview(Windows Forms) button column? if yes,

can you help me how to do it?

Thank you,

Regards

Exelio
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
Exelio is offline Offline
57 posts
since Aug 2006
Oct 10th, 2007
0

Re: Regarding images in button column of datagridview

Are you speaking of the Header cells, or a data cell ?

I havn't tried it on tried it on the header, however I am pretty sure it can be done.
If you are speaking of data cells, you can use the
CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)

CellFormatting event to set the e.Value to an image.

//Jerry
Reputation Points: 69
Solved Threads: 75
Posting Pro in Training
JerryShaw is offline Offline
465 posts
since Nov 2006
Dec 14th, 2007
0

Re: Regarding images in button column of datagridview

Hi Exelio,

Yes I think it is possible. Just click on the gridview and click edit columns and then select the particular cell which you wanted to make a button and then in the Bound Column properties Window choose Column type under the design and select DataGridViewImageColumn for the columnType which you want the image to appear on. Then under the Appearance in the Bound Column properties you see the image text on the left side. just click on the right side infront of image text, then a window will pop up from there you can select your image. It should appear on all the buttons in the gridview.

Hope this helps

Cheers

Kisankoori.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Kisankoori is offline Offline
2 posts
since Dec 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Problem with GridView
Next Thread in C# Forum Timeline: Databinding problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC