|
avisharma@sharma wrote: How could i do this please Same way as a button column; you handle the CellClick[^] event of the DataGridView . It works the same for button and text-columns.
avisharma@sharma wrote: help me its urgent. No, it ain't. We're volunteers, it cannot be urgent here.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Sorry Eddy its mistake. No Urgent I understand
|
|
|
|
|
Hi Eddy, but can you please provide me the code for saving the cell click means that it is clicked into the database because there is a need .
|
|
|
|
|
Check the link, it contains an example (without the database code).
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Perhaps you can help me in my search as I know very little C#. I'm looking at delegating functions and marshalling the function pointer to a win32 p/invoke function. I think my issue is with delegating. Basically I've set up a delegate function (to simplify I'll use):
public delegate void Foo(int x);
Then I declared a delegate member
Foo f;
Then I assign it to an appropriate function:
f = this.MyFoo;
Which was declared like:
public void MyFoo(int x){...}
I then get the function pointer via Marshalling:
win32function(handle, Marshal.GetFunctionPointerForDelegate(f));
Currently I'm getting an error for the win32function() of invalid parameters. The only parameter I cannot be sure is correct is the function pointer I'm passing [the win32 function is looking for a callback function]
I'm assuming I'm not completing getting the picture of delegating. Any ideas?
I can dump the working code into the forum but I was trying to keep things simple.
Thanx
Dennis
|
|
|
|
|
I think you need to use the UnmanagedFunctionPointerAttribute on your delegate; see if this is useful: [^].
« There is only one difference between a madman and me. The madman thinks he is sane. I know I am mad. » Salvador Dali
|
|
|
|
|
hi every one
i want when i click icon save in navigator that i new record that updat as case select record and add database but not all record select and show one of record is null beacasue not column select. please help me one of column add with value 0 beacasue not column select. and for add record whiout 0 value i was in run one click after edit a record but i dont click i want in code a click after edit that record to be select how this write .
my code:
try
{
((DataRowView)fatemeBindingSource.Current).Row["code"] = codemax;
int g, b;
g = Convert.ToInt32(gridEX1.CurrentRow.Cells["code_b"].Value);
b = Convert.ToInt32(gridEX1.CurrentRow.Cells["name"].Value);
((DataRowView)fatemeBindingSource.Current).Row["code_b"] = g;
((DataRowView)fatemeBindingSource.Current).Row["name"] = b;
fatemeBindingSource.EndEdit();
fatemeTableAdapter.Update(this.baziDataSet.fateme);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
best regards
|
|
|
|
|
my problem is a select last column in grid jans that not to be select.
please help me i am tired .i am cellselectionmode =entirerow
but not select colunm last gridjanus.
please help me
modified 7-Oct-14 17:34pm.
|
|
|
|
|
please help me. i am wating guide for solve problem.
best regards
|
|
|
|
|
My question is how can we save button click event state in database that whether it is clicked or not means if user click the button then automatically it will save as yes in database. I am using SQL Serve 2008 r2
Please help me out
Thanks
-- modified 7-Oct-14 8:50am.
|
|
|
|
|
How do you intend to notify the database that the user has NOT clicked the button.
Trapping the click event is trivial and will depend on the UI you are using, you did not mention that!
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mr. Mycroft I don't know whether you know or not but
"Human Stupidity Is the FATHER of INNOVATION"
I clearly mention that this application is in windows Form and you going on talking about UI if you are not able to give the answer then please don't make it complex.
I know you are a intellectual programmer but please. And thanks for your reply
|
|
|
|
|
Before you get insulting, you should really check what you posted. In your post you state
"My question is how can we save button click event state in database that whether it is clicked or not means if user click the button then automatically it will saved as yes in database else
no. I am using SQL Serve 2008 r2
Please help me out
Thanks"
Where, in that, does it say anything about Windows Forms?
|
|
|
|
|
AMRITESH ASTHANA wrote: Human Stupidity Is the FATHER of INNOVATION It is a quote!
AMRITESH ASTHANA wrote: I clearly mention that this application is in windows Form Where!
If you are using windows forms then trap the click event (double click on the button in the designer to create the stub).
Check the value of the control and write the result to the database.
However your design is stinks, what happens if the user never clicks the button, what happens if the user clicks the button 15 times.
And yes I am trying to make it complex, you need to think through what the user can do. It seems a checkbox would be a better control for this requirement.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
can some body tell me about the logic for creating my own forum using c# in asp.net?
|
|
|
|
|
Where are you stuck? Clearly you'll need a database to store your data but then the layout and how it works is up to you.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
I'd recommend downloading an open-source forum-application for ASP.NET, and taking a look at the source-code.
That text is the programming logic. If you want to create your own you should study C#. If you want to be up and running quickly and mucking with databases fast, I'd recommend the tutorials from w3schools.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
For forum source you could try
DotNetNuke http:
http:
http:
A feature limited free version of Community Server, the same software that this Forum runs on is available here - http:
http:
http:
http:
http:
Sankarsan Parida
|
|
|
|
|
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
|
|
|
|
|
|
Mr. Eddy You are disgusting and your Code is just like you means disgusting just make "garbage collector" of your code.
|
|
|
|
|
You are welcome
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
hi every body
I have an app written by C# that exchange the words by keyboard mistake between two language(En & Fa, and now i want to add it to Microsoft office word as an Add-in but i don't know what to do!
can anyone help me about it?
thanks in advance
best regards
Nashalj
|
|
|
|
|
You can start by searching CodeProject for "Microsoft Word Add-In," and similar search keys, which will lead you to resources like:
Writing a Word Add-In - Part 0 by David Thielen
Article 12 Jan 2005 license: N/A
Learn to write an add-in in C# that does everything a regular C# program does.
Writing a Word Add-in - Part I by David Thielen
An explanation of what you need to know to write a Word add-in in C#.
Article 13 Jan 2005 license: N/A
« There is only one difference between a madman and me. The madman thinks he is sane. I know I am mad. » Salvador Dali
|
|
|
|
|
here i have attached my full code. i wrote SqlDependency related code in windows service which will fire mail when any data change found in a specific table in database. when i start my service then it is working fine. suppose when i start my service and after that when i change data in table then i saw mail is coming but from the next day when i change data in table then i am not getting any mail. some how SqlDependency is getting freeze or stuck but i am not being able to catch where is the problem lies in the code.
so please see my windows service code and guide me where i am making the mistake for which SqlDependency is not working every time properly.
public partial class PartIndexer : ServiceBase
{
static string connectionString = "MyConnection String;Pooling=true;Connect Timeout=20;";
SqlDependency dep;
public PartIndexer()
{
InitializeComponent();
}
#region OnStart
protected override void OnStart(string[] args)
{
System.Data.SqlClient.SqlDependency.Stop(connectionString);
System.Data.SqlClient.SqlDependency.Start(connectionString);
RegisterNotification();
MailNotify("STARTED");
}
#endregion
#region RegisterNotification
private void RegisterNotification()
{
string tmpdata = "";
try
{
using (SqlConnection conn = new SqlConnection(connectionString))
{
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT ActivityDate FROM [bba-reman].ContentChangeLog";
dep = new SqlDependency(cmd);
dep.OnChange += new OnChangeEventHandler(OnDataChange);
SqlDataReader dr = cmd.ExecuteReader();
{
while (dr.Read())
{
if (dr[0] != DBNull.Value)
{
tmpdata = dr[0].ToString();
}
}
}
dr.Dispose();
cmd.Dispose();
}
}
finally
{
}
}
#endregion
#region OnDataChange
void OnDataChange(object sender, SqlNotificationEventArgs e)
{
SqlDependency dep = sender as SqlDependency;
dep.OnChange -= new OnChangeEventHandler(OnDataChange);
SendMailNotification();
RegisterNotification();
}
#endregion
#region StartIndex
void SendMailNotification()
{
}
#endregion
#region MailNotify
void MailNotify(string strStatus)
{
if (strStatus == "STARTED")
{
var template = new MailTemplate()
.WithBody("HI,<br><br>Part Indexer Started Date " + DateTime.Now.ToLongDateString())
.WithSubject("Part Indexer Started")
.WithSender("xxxxx")
.WithRecepient("xxxx")
.Send();
}
else if (strStatus == "STOPPED")
{
var template = new MailTemplate()
.WithBody("HI,<br><br>Part Indexer stopped Date " + DateTime.Now.ToLongDateString())
.WithSubject("Part Indexer Stopped")
.WithSender("xxx")
.WithRecepient("xxx")
.Send();
}
}
#endregion
#region OnStop
protected override void OnStop()
{
System.Data.SqlClient.SqlDependency.Stop(connectionString);
MailNotify("STOPPED");
}
#endregion
}
tbhattacharjee
|
|
|
|