|
I have populated a datagridview control with decimal numbers as below.
It also has a last row as Total.
How do I sum the figures in each column to place into the appropriate cell for the final row i.e. Total row?
Thanks
country column1 column2 column3
Russia 24,987.524 543,711,654.890 5,554.875
UK 65,977.324 513,311,254.690 6,654.175
US 84,987.524 943,711,654.890 3,554.875
Total
|
|
|
|
|
In order to get the summation there might be some methods exposed by the datagridview.
If not,then you can use the values from the dataset whuch you have used in the previous case to populate the datagridview....
I hope that helps you out....
|
|
|
|
|
If you use web form, you can use the footer. If you use win form, you probably need to insert a row in the datasource for the total. Don't think there's footer in datagridview for winforms I don't think.
|
|
|
|
|
I've got a setup project that installs fine on a clean machine but i get an error when I try to install over the top of a previous install.
This is a problem i ran into ages ago but i left it as I was the only person doing installs at the time. Now that the software is being tested I need to get the setup process working right.
Having read up loads about the issues involved i cam to the following conclusions:
DetectNewerInstalledVersion should be set to true
InstallAllUsers should be the same for every build (Set to true)
ProductCode should be updated every build (As suggested by VS when the verion number is changed)
Upgrade code remains the same for all builds at the moment
Version number is changed per build
When i build and install this package I get a duplicate in Add/Remove programs, I guess it's better than an error but it's still not great, does anyone know what i've done wrong?
Cheers
Russell
|
|
|
|
|
Can we write Games in C# ......other than board games
Please send the links ....
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
ALT + F4 wrote: Can we write Games in C# ......other than board games
Please send the links ....
Yes and No. Now, it's up to you to guess which answer goes with which part of your post.
[Hint]There's this new-fangled technology that you probably haven't heard of called a search-engine that might, just possibly, be able to search for answers for you[/Hint].
|
|
|
|
|
I didn't know the CodeProject forum supports hint modes... Hrrrmmmm interesting may remember that for the future...
|
|
|
|
|
Thank You Pete O hanlon
I am following your hint
want to say ....."a unexpected reply from a expected person "
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Yep, you can and pretty good! You have to be more specific though, what kind of game would you like to develop....
|
|
|
|
|
I came to know that Arena Wars is developed in C#
want to know what are the basic requirements for developing a game i mean to say which classes i need to know ...........
Thank You Eduard Keilholz
I appreciate proper reply's
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Yeah, well there's a kind of framework vor game development called DirectX, it contains several classes for handling graphics, sound, user input (joysticks etc) everything your game needs. Since a while Microsoft brought an environment called XNA which you can use to develop games. It uses DirectX, but DirectX may become pretty complicated, XNA helps you out a lot of times, but don't underestimate game developers, you cannot just write a game like typing a letter in Word or so...
|
|
|
|
|
You can make a game in any language mate...
Try "XNA" or "DirectX" in a google search though if you want specific game building frameworks.
Mark.
|
|
|
|
|
Thanks for replying MarkBrock..
Can you give me a example of that game ...
I know asking for a code is a horrible thing ...
still any suggestions are welcome ...
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
I see you mentioned Arena Wars above, is that the sort of game you want to try and make?
You need to understand that the question you are asking is very vague.
If you want to build a simple windows game you can make it using a basic windows form and a picture box.
If you want to build something a bit more visually appealing (like Arena Wars) then your going down the road of DirectX and XNA - which is more complicated.
If you want to develop using DirectX in C#, google search and download the DirectX SDK. But I would recommend you google 'XNA' (and download it) and use that to start with.
Game programming is fun - but it takes a lot of work and patience to get a firm grip on all the different technologies and platforms you can develop with.
Mark.
|
|
|
|
|
Thanks for Your Valuable Reply..... I hope with practice and efforts i can learn using XNA,DIRECTX ....for developing games
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
|
Games programming is an incredibly complex topic. As mentioned, there's XNA/DirectX and also OpenGL. Then there's 2D and 3D. I would strongly recommend that you buy books on the area you are interested in and learn from those. Start off by learning the basic principals in 2D before attempting 3D - you really don't want to end up being discouraged early on.
If you are going the XNA route, there's a good games engine called Torque (by Garage Games) that coexists with it. This has lots of samples for you to work through, and could be a good place to start.
|
|
|
|
|
Thanks a lot for the reply's ..thanks to codeproject too
I have found where to initiate
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Clickety
You always pass failure on the way to success.
|
|
|
|
|
ALT + F4 wrote: other than board games
Sure; card games, dice games...
Probably not reindeer games though.
|
|
|
|
|
Hello,
I have created a windows service in c#. I would like to use windows service and print the "x" value in the active window wherever the cursor located. I have used Keybd_event to print the value. Unfortunately i am unable to see the value in the active window. I assume Keybd_event is not fired. I have added log messages before and after keybd_event event, log messages are creating perfectly. However if i use the same code to print the value from an windows application i am able to print the value. I am attaching my code whatever i have used to print the value
Here is the code i have used in windows service and application
using System;
using System.Collections.Generic;
using System.Text;
namespace SmartcardLibrary
{
public class PrintToScreen : KeyboardEvents
{
private static log4net.ILog logError = log4net.LogManager.GetLogger("SmartCardErrorLogger");
private const string NEW_LINE = "\n";
private const uint KEYEVENTFKEYUP = 0x2;
private const byte VKCAPSLOCK = 0x14;
private const byte SCCAPSLOCK = 0xBA;
private const byte VKTAB = 0x09;
private const byte SCTAB = 0x8F;
public static void Print(string input)
{
try
{
//logError.Error("PRINT SCREEN TAG ID: " + input + NEW_LINE);
input = input.ToUpper();
byte[] virtualKey = Encoding.UTF8.GetBytes(input);
byte[] bScanCode = new byte[input.Length];
for (int count = 0; count < virtualKey.Length; count++)
{
bScanCode[count] = ScanCode(virtualKey[count]);
}
for (int i = 0; i < virtualKey.Length; i++)
{
if (GetKeyState(VKCAPSLOCK) == 0)
keybd_event(VKCAPSLOCK, SCCAPSLOCK, 0, 0); //Caps Lock Press Event
keybd_event(virtualKey[i], bScanCode[i], 0, 0); //Key press event
//UnsafeNativeMethods.keybd_event(virtualKey[i], bScanCode[i], KEYEVENTF_KEYUP, 0); //Key release event
//UnsafeNativeMethods.keybd_event(VKCAPSLOCK, SCCAPSLOCK, KEYEVENTFKEYUP, 0); //Caps Lock release Event
}
keybd_event(VKTAB, SCTAB, 0, 0); //Tab press event
//logError.Error(input + NEW_LINE + NEW_LINE);
}
catch (Exception ex)
{
logError.Error(ex.Message + NEW_LINE + ex.StackTrace);
}
}
private static byte ScanCode(byte Character)
{
byte result = Convert.ToByte(MapVirtualKey(Character, 0x1)); //0x1 indicates VirtualCode to Scan code conversion
return result;
}
}///
}///
This code is working for application but not working for windows service...
your suggestions on this issue would be appreciated
|
|
|
|
|
Ummm... your Windows Service has an "active window"?
You probably don't want a Windows Service; won't a simple thread suffice?
What are you trying to do?
|
|
|
|
|
Hi,
I am building a web browser in C#.I am required to dynamically edit the Html Page currently displayed and add a javacript to it.How do i go about it?
After adding,how do I invoke this javascript?
Thanks in advance.....
|
|
|
|
|
You can add Javascript using the ClientScript.RegisterClientScriptBlock() method. You can also make sure the script is not already registered for the page by checking the ClientScript.IsClientScriptBlockRegistered property.
You can invoke the method by either adding a onload attribute to the body tag of your page, or just by calling a function in your javascript.
|
|
|
|
|
Which object exactly exposes this method ClientScript.RegisterClientScriptBlock()?
Am i missing any references in the project? namely System.Xml?
|
|
|
|