Click here to Skip to main content
15,896,348 members
Home / Discussions / C#
   

C#

 
QuestionTo make dataGridView Table cell into Button Pin
avisharma@sharma8-Oct-14 0:01
avisharma@sharma8-Oct-14 0:01 
AnswerRe: To make dataGridView Table cell into Button Pin
Eddy Vluggen8-Oct-14 0:30
professionalEddy Vluggen8-Oct-14 0:30 
GeneralRe: To make dataGridView Table cell into Button Pin
avisharma@sharma8-Oct-14 0:43
avisharma@sharma8-Oct-14 0:43 
GeneralRe: To make dataGridView Table cell into Button Pin
avisharma@sharma8-Oct-14 0:52
avisharma@sharma8-Oct-14 0:52 
GeneralRe: To make dataGridView Table cell into Button Pin
Eddy Vluggen8-Oct-14 1:05
professionalEddy Vluggen8-Oct-14 1:05 
Questiondelegates and marshalling Pin
Member 111363017-Oct-14 11:30
Member 111363017-Oct-14 11:30 
AnswerRe: delegates and marshalling Pin
BillWoodruff7-Oct-14 19:55
professionalBillWoodruff7-Oct-14 19:55 
Questioni am tired guides for how to select new record in gridex janus for add in database Pin
fatemehsoleimani7-Oct-14 4:59
fatemehsoleimani7-Oct-14 4:59 
AnswerRe: how to select new record in gridex janus for add in database Pin
fatemehsoleimani7-Oct-14 11:18
fatemehsoleimani7-Oct-14 11:18 
GeneralRe: how to select new record in gridex janus for add in database Pin
fatemehsoleimani9-Oct-14 3:51
fatemehsoleimani9-Oct-14 3:51 
QuestionSaving the button click event state in database Pin
AMRITESH ASTHANA6-Oct-14 20:58
AMRITESH ASTHANA6-Oct-14 20:58 
AnswerRe: Saving the button click event state in database Pin
Mycroft Holmes6-Oct-14 21:20
professionalMycroft Holmes6-Oct-14 21:20 
GeneralRe: Saving the button click event state in database Pin
AMRITESH ASTHANA6-Oct-14 23:04
AMRITESH ASTHANA6-Oct-14 23:04 
GeneralRe: Saving the button click event state in database Pin
Pete O'Hanlon6-Oct-14 23:16
mvePete O'Hanlon6-Oct-14 23:16 
GeneralRe: Saving the button click event state in database Pin
Mycroft Holmes6-Oct-14 23:17
professionalMycroft Holmes6-Oct-14 23:17 
QuestionAbout Creating Forum with asp.net c# Pin
Member 105764386-Oct-14 4:20
Member 105764386-Oct-14 4:20 
AnswerRe: About Creating Forum with asp.net c# Pin
ZurdoDev6-Oct-14 5:07
professionalZurdoDev6-Oct-14 5:07 
AnswerRe: About Creating Forum with asp.net c# Pin
Eddy Vluggen6-Oct-14 8:25
professionalEddy Vluggen6-Oct-14 8:25 
AnswerRe: About Creating Forum with asp.net c# Pin
sankarsan parida7-Oct-14 18:36
professionalsankarsan parida7-Oct-14 18:36 
QuestionDisabling DataGridView Column Button after clicking it Pin
AMRITESH ASTHANA6-Oct-14 1:11
AMRITESH ASTHANA6-Oct-14 1:11 
I am developing application in c# windows form . I have a need to put button in cell of datagridview this button perform an action of sending mail. What I have to do is after clicking this column button it must have to be disabled and it must to be disabled without using check box just after clicking.
Please help me i struck over here i am unable to make this happen.

--------------------------code--------------------------------

namespace WindowsFormsApplication7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
DataGridViewButtonColumn btn = new DataGridViewButtonColumn();

private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 3)
{
MessageBox.Show(" Row & column");

dataGridView1.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.Gray; // for making the row highlighted

}

}



private void button1_Click(object sender, EventArgs e)
{
dataGridView1.ColumnCount = 3;
dataGridView1.Columns[0].Name = "Product ID";
dataGridView1.Columns[1].Name = "Product Name";
dataGridView1.Columns[2].Name = "Product Price";

string[] row = new string[] { "1", "Product 1", "1000" };
dataGridView1.Rows.Add(row);
row = new string[] { "1", "Product 2", "2000" };
dataGridView1.Rows.Add(row);
row = new string[] { "3", "Product 3", "3000" };
dataGridView1.Rows.Add(row);
row = new string[] { "4", "Product 4", "4000" };
dataGridView1.Rows.Add(row);


DataGridViewButtonColumn btn = new DataGridViewButtonColumn();
dataGridView1.Columns.Add(btn);
btn.HeaderText = "Click Data";
btn.Text = "Click Here";
btn.Name = "btn";
btn.UseColumnTextForButtonValue = true
}
}
}

Thanks
AnswerRe: Disabling DataGridView Column Button after clicking it Pin
Eddy Vluggen6-Oct-14 8:21
professionalEddy Vluggen6-Oct-14 8:21 
GeneralRe: Disabling DataGridView Column Button after clicking it Pin
AMRITESH ASTHANA6-Oct-14 21:29
AMRITESH ASTHANA6-Oct-14 21:29 
GeneralRe: Disabling DataGridView Column Button after clicking it Pin
Eddy Vluggen6-Oct-14 22:31
professionalEddy Vluggen6-Oct-14 22:31 
QuestionHow to add my app written by C# into Microsoft word as add-in? Pin
nashalj5-Oct-14 21:23
nashalj5-Oct-14 21:23 
AnswerRe: How to add my app written by C# into Microsoft word as add-in? Pin
BillWoodruff5-Oct-14 21:56
professionalBillWoodruff5-Oct-14 21:56 

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.