[Solved] Command buttons on GridView view
Posted
#1
(In Topic #1092)
Enthusiast

Not sure if this has been asked before but I need some help, does anyone know how I can have a set of command buttons on a row on a GridView?
Below is a example of what I mean (what I want to have is edit / delete / duplicate)
<IMG src="https://www.codeproject.com/KB/grid/DGV_ImageButtonCell/CodeProject01.JPG">
If anyone could show me an example or point me in the right direction that would be most appreciated.
Thanks
Andy
Posted
Guru

I cannot find DataGrid on the wiki anywhere.
Posted
Enthusiast

Posted
Guru

A GridView is a ScrollView at heart and the grid and it's items are drawn.
So it's contents (cells) are not individual containers you can add controls to like Buttons.
The easiest way to get what you want is to use the _GridView_Cell.Picture property to use an image and make it act like a button.
See the attached project.
I customised GridView to have a .MakeButton() method
GridView1.MakeButton(GridView1.Rows.Max, 0, "icon:/22/edit")
It makes a fake button and responds to clicks using a ButtonClick() event.
Public Sub GridView1_ButtonClick(Row As Integer, Column As Integer)
Putting the attached projects GridView.class in your own projects .src directory and hitting "compile all" will allow you to do the same for your GridViews
Posted
Regular

If you want, you can insert a Button in a cell of the GridView:AndyGable said
how I can have a set of command buttons on a row on a GridView?
:? Inserire un oggetto in una cella di una GridView - Gambas-it.org - Wikipedia
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Enthusiast

vuott said
If you want, you can insert a Button in a cell of the GridView:AndyGable said
how I can have a set of command buttons on a row on a GridView?
:? Inserire un oggetto in una cella di una GridView - Gambas-it.org - Wikipedia
Thank for that post I shall have a read and go from there
This is what I am looking for
1 guest and 0 members have just viewed this.



