Click here to Skip to main content
15,883,901 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to create Textbox with ellipse button Pin
Ravi Bhavnani18-Mar-14 5:42
professionalRavi Bhavnani18-Mar-14 5:42 
GeneralRe: How to create Textbox with ellipse button Pin
ahmed_one18-Mar-14 5:51
ahmed_one18-Mar-14 5:51 
GeneralRe: How to create Textbox with ellipse button Pin
Ravi Bhavnani18-Mar-14 6:06
professionalRavi Bhavnani18-Mar-14 6:06 
AnswerMSDN solution Pin
Ravi Bhavnani18-Mar-14 6:08
professionalRavi Bhavnani18-Mar-14 6:08 
AnswerRe: How to create Textbox with ellipse button Pin
BillWoodruff18-Mar-14 6:01
professionalBillWoodruff18-Mar-14 6:01 
GeneralRe: How to create Textbox with ellipse button Pin
ahmed_one18-Mar-14 6:18
ahmed_one18-Mar-14 6:18 
GeneralRe: How to create Textbox with ellipse button Pin
BillWoodruff18-Mar-14 7:00
professionalBillWoodruff18-Mar-14 7:00 
AnswerRe: How to create Textbox with ellipse button Pin
Alan N18-Mar-14 7:36
Alan N18-Mar-14 7:36 
Why not just add a column of buttons next to the text column. The simplest and easiest way to do this would be to add an unbound DataGridViewButtonColumn to the DataGridView in the DataBindingComplete event and then handle the CellContentClick event to respond to button clicks.

Sample event handlers for a DataGridView 'dgv' on a Form 'Form1'

C#
int buttonColumnIndex;  // to identify the button column in the CellContentClick handler

public Form1() {
  InitializeComponent();
  // add the event handlers
  dgv.CellContentClick += new DataGridViewCellEventHandler(dgv_CellContentClick);
  dgv.DataBindingComplete += new DataGridViewBindingCompleteEventHandler(dgv_DataBindingComplete);
}

private void dgv_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) {
  DataGridViewButtonColumn bc = new DataGridViewButtonColumn();
  bc.Name = "ButtonColumn";
  bc.HeaderText = "";
  bc.UseColumnTextForButtonValue = true;
  bc.Text = "Edit";
  bc.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells;
  buttonColumnIndex = dgv.Columns.Add(bc);
  // Column will be at the right, move to the required position
  // e.g move to left
  dgv.Columns[buttonColumnIndex].DisplayIndex = 0;
}

private void dgv_CellContentClick(object sender, DataGridViewCellEventArgs e) {
  if (e.ColumnIndex == buttonColumnIndex) {
    MessageBox.Show(String.Format("Edit button clicked on row {0}", e.RowIndex));
  }
}

Alan...
GeneralRe: How to create Textbox with ellipse button Pin
ahmed_one18-Mar-14 18:12
ahmed_one18-Mar-14 18:12 
QuestionCalculating the area of a self intersecting polygon Pin
Member 1067580817-Mar-14 23:38
Member 1067580817-Mar-14 23:38 
SuggestionRe: Calculating the area of a self intersecting polygon Pin
Richard MacCutchan18-Mar-14 0:47
mveRichard MacCutchan18-Mar-14 0:47 
QuestionHow to solve a non linear Equation is Visual studio 2012/C# Pin
Nadish Anand17-Mar-14 15:06
Nadish Anand17-Mar-14 15:06 
AnswerRe: How to solve a non linear Equation is Visual studio 2012/C# Pin
Bernhard Hiller17-Mar-14 22:14
Bernhard Hiller17-Mar-14 22:14 
AnswerRe: How to solve a non linear Equation is Visual studio 2012/C# Pin
Matt T Heffron18-Mar-14 8:30
professionalMatt T Heffron18-Mar-14 8:30 
QuestionWhat is used to identify a Generic Type Parameter? Pin
Jörgen Andersson16-Mar-14 10:33
professionalJörgen Andersson16-Mar-14 10:33 
AnswerRe: What is used to identify a Generic Type Parameter? Pin
BillWoodruff16-Mar-14 20:01
professionalBillWoodruff16-Mar-14 20:01 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Jörgen Andersson16-Mar-14 20:59
professionalJörgen Andersson16-Mar-14 20:59 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Pete O'Hanlon17-Mar-14 12:06
mvePete O'Hanlon17-Mar-14 12:06 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
BillWoodruff17-Mar-14 18:51
professionalBillWoodruff17-Mar-14 18:51 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Pete O'Hanlon17-Mar-14 21:15
mvePete O'Hanlon17-Mar-14 21:15 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Jörgen Andersson17-Mar-14 21:53
professionalJörgen Andersson17-Mar-14 21:53 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Pete O'Hanlon17-Mar-14 22:42
mvePete O'Hanlon17-Mar-14 22:42 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Jörgen Andersson17-Mar-14 23:43
professionalJörgen Andersson17-Mar-14 23:43 
GeneralRe: What is used to identify a Generic Type Parameter? Pin
Pete O'Hanlon18-Mar-14 0:50
mvePete O'Hanlon18-Mar-14 0:50 
QuestionAutomapper exception when converting object with inheriting members Pin
impeham16-Mar-14 5:19
impeham16-Mar-14 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.