|
You have complete control over the datagrid, so yes, there is a way to add a totals column.
One way would be to add it to your query.
SELECT field1, field2, SUM(field3) FROM...
Another way would be to handle the databinding events and populate the column at runtime.
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote:
SELECT field1, field2, SUM(field3) FROM...
Call me an idiot but tell me this's not creating me a totals row (not column)
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
If you had a table with this structure
col1 col2
1 2
10 20
20 30
then SELECT col1, col2, SUM(col1,col2)...
would produce this:
1,2,3
10,20,30
20,30,50
Of course this only gives you the totals for the rows selected. If you want some other sort of total, then adjust the SQL statement, maybe MAX, or AVE, or whatever is needed.
only two letters away from being an asset
|
|
|
|
|
If you are using a DataSet as data source then you can add an expression column to it.
-^-^-^-^-^-
no risk no funk ................... please vote ------>
|
|
|
|
|
hi all,
iam working on directx.capture class library, iam not able to run the sample code included in the zip file. i get the above error at
private Filters filters = new Filters();
please somebody help me with this. iam using vs2005 express edition
Thanks in advance
|
|
|
|
|
Hi
I have this Sql Authentication connection string which has a username and password.
I added this connection string to Application Settings and the corresponding app.config item
was added to my project automatically. But now that i want to access the app.config file
in my codes,ConfigurationSection,ConfigurationManager and other related classes,properties and methods
are not available.I read many articles on this subject but i havent been able to do the encryption so far.
The other question is wether the encryption needs to be done once or should it be done every time
the application runs? Is it be possible to set this encrypted connection as a SqlConnection's connection
string or the assignment must be done prior to encryption?
please help!
thanks
|
|
|
|
|
try this
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2010907&SiteID=1&pageid=0#2010907
|
|
|
|
|
I have a WinForms MDI app that has a docked navigation panel at the left edge. However, when I create MDI child windows, the main window seems to ignore the presence of the navigation panel and uses its entire client area to layout the child windows. Is it possible to override the MDI container's layout logic and reduce its client area by the space occupied by the navigation panel?
I tried doing this in the main window's Load handler, but it didn't seem to have any effect. (I understand that this would only set the initial client area, which may need to be recomputed in a SizeChanged handler).
private void MainFrm_Load
(object sender,
EventArgs e)
{
NavigatorFrm nf = new NavigatorFrm();
nf.MdiParent = this;
nf.Dock = DockStyle.Left;
nf.Show();
this.ClientSize = new Size (this.ClientSize.Width - nf.Width, this.ClientSize.Height);
}
Thanks,
/ravi
|
|
|
|
|
If you get an answer to this, I'd be interested to find out how to do it.
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
If still anyone is looking for this, just override the control's DisplayRectangle property. Just mentioned as I was looking for the same till a few days ago.
|
|
|
|
|
Hi,
I want to display a description of the item being hovered over, how would i do this please.
|
|
|
|
|
Use a tooltip.
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
Or a balloon
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
That is a nice article you linked to. I am wondering why it was voted down a bit... It may be an older article from 2002, but the information looks still useful.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hello,
Has anyone got an upto date and working version of a gamequery library?
i have attempted to fix the one located at http://www.codeproject.com/csharp/gameserverinfo.asp?df=100&forumid=128181&exp=1&mpp=50&select=2186981&msg=2186981
However the skill needed is beyond me, and i have recived no e-mail from the original writer.
So anyone able to assist me?
Cheers
|
|
|
|
|
hi,
I want to display the time and date in a textbox using c# where i should put the formula and how
regards
|
|
|
|
|
Use System.DateTime.Now
textbox.Text=System.DateTime.Now.ToString();
at page load or any buttion's click event wherever you want.
Naresh Patel
|
|
|
|
|
exactly. and use a timer if u want it to look like a clock
there are no facts, only interpretations
|
|
|
|
|
And use the conditional operator ?: to format it like a real clock
int Hours = ((YourTimeVariable / 1000) / 3600);
int Minutes = ((YourTimeVariable / 1000) / 60) - (Hours * 60);
int Seconds = ((((YourTimeVariable / 1000)) - (Minutes * 60)) - (Hours * 3600));
strHours = Hours < 10 ? "0" + Hours.ToString() : Hours.ToString();
strMinutes = Minutes < 10 ? "0" + Minutes.ToString() : Minutes.ToString();
strSeconds = Seconds < 10 ? "0" + Seconds.ToString() : Seconds.ToString();
Time_TextBox.Text = strHours + ":" + strMinutes + ":" + strSeconds;
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Muammar© wrote: strHours = Hours < 10 ? "0" + Hours.ToString() : Hours.ToString();
strHours = Hours.ToString("D2"); etc. will suffice.
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Have I been re-invinting the wheel?
Thanks Luc .. I didnt' know it.
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
Or maybe just use the ToString method
DateTime.Now.ToString("hh:mm:ss");
only two letters away from being an asset
|
|
|
|
|
Mark Nischalke wrote: DateTime.Now.ToString("hh:mm:ss");
DOH!!
Thank you guys
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
By the way, your sig made me laugh so much a couple of months ago,yet I want to know if my understanding was correct so please tell me what it really means:->
Smile: A curve that can set a lot of things straight!
(\ /)
(O.o)
(><)
|
|
|
|
|
or be lazy and use DateTime.ToLongTimeString ( alternatively :DateTime.ToShortTimeString ) methods
there are no facts, only interpretations
|
|
|
|