>
In my application, I have a DataGridViewbuttonColumn manually added to my DataGridView that I use to zoom in on a record. It works great.
>
>I want to try to pretty up the button a little bit. Instead of just saying "Zoom", I would like a button with a magnifying glass on it, or something like that. Does anybody know how to do this? >
>Hey Mike,
>
>There are probably dozens of ways to do this. Here's how I do it, by adding an icon column. I create a ButtonField object, set some properties, and add the object to the GridView.
>
>
>
>ButtonField obt = new ButtonField();
>obt.CommandName = "Select";
>obt.ButtonType = ButtonType.Image;
>obt.ImageUrl = "openfolder.ico"; // or whatever icon you want
>
>this.grdResults.Columns.Add(obt);
>
>
>I'm guessing you already know this - clicking the button will fire the gridview's SelectedIndexChanged event, where you can grab the current gridview row.
>
>Let me know if that helps...
>
>P.S. I just realized that my brain is fried tonight - I pasted in some code from a webforms app. good grief! Well, the code may or may not work, sorry.
>
>
>
>Kevin
Kevin,
I had actually found the icon column late yesterday afternoon, but haven't quite gotten it to do what I want it to do yet. I will post some code when I get it figured out. Thanks!