Hi i have data gridview button column its displaying button fine …. but it occupies entire cell in every row like below figure .. buy is the column name …… i want to resize the button to oval shape ……
how can i do this……and this is my code for button column code….
DataGridViewButtonColumn column = new DataGridViewButtonColumn();
daatgridview1.Columns.Add(column);
column.Resizable = DataGridViewTriState.True;
column.FlatStyle = FlatStyle.Popup;
column.DefaultCellStyle.BackColor = Color.Green;
column.Text = "Buy";
column.HeaderText = "Buy";
column.UseColumnTextForButtonValue = true;
column.Name = "btnbuy";
would any one pls help on this one ……
Set the column style´d
Paddingproperty to a padding that fits. It will increase the distance between your button and the grid´s grid lines.“Gets or sets the space between the edge of a DataGridViewCell and its content.” — http://msdn.microsoft.com/de-de/library/system.windows.forms.datagridviewcellstyle.padding.aspx
Be sure to set the style on the correct “layer” so you don´t end up setting this for each cell individually.