Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DataGridViewButtonColumn
Message
De
14/08/2007 11:25:23
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
13/08/2007 22:58:13
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Versions des environnements
Environment:
VB 8.0
Divers
Thread ID:
01247931
Message ID:
01248056
Vues:
26
>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!
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform