|
Here is a quick though. Why don't you format the date before you bind the data to the grid. That way it is what you need it to look like and no formatting is required in the grid? If you need to sort still, then make a hidden column of DateTime type and use it for sorting.
Hogan
|
|
|
|
|
Hello,
This is a great thought however I have no idea what fields I will be receiving and how they are named. The tool I am developing will allow me to take any file with any header and standardize it before it goes into a system. The files I receive are really messy and you never know what you are going to get and at what position the headers are in. therefore, I would need to import the dataset into the app, apply the new headers then format. Thanks again for the reply. Any ideas on how I could do this or maybe improve or modify the existing code to get the app to do what I need it to do?
|
|
|
|
|
Hi
I need to transfer some files to my server in a secure way with my application. What I mean with "secure" is login info cannot be exposed by a network sniffer. Data doesn't have to be encrypted but it doesn't actually matter, it can be encrypted too.
I know that FTPS or SFTP can work for me but I need some 3rd party components to use them and I couldn't find a free one. (Well, I need a free one) And I am not capable of writing my own class for FTPS or SFTP.
Thanks.
|
|
|
|
|
I at all!!!
I'm trying to build a text box.
But wndproc event handler never raise a wm_char (code 0x0102) event...
Anyone could help me?
|
|
|
|
|
Alquerque wrote: Anyone could help me?
Use TextBox.
|
|
|
|
|
I want write text in an sdl window for this reason i will to create this control but keypress event need to map keyboard so i'll try to use wndproc...
|
|
|
|
|
Hi Dear
I use VS2005 , in windows app i want to have a thousand separator for numbers that shown in Textbox or MaskTextBox.
How can i do that?
|
|
|
|
|
thousand separator means ??
Do you want to create a custom textbox control??
|
|
|
|
|
Either use string.Format() or numberVariable.ToString(string formatString) to set the text for the TextBox
myTextBox.Text = string.Format(formatString goes here, numberVariable);
myTextBox.Text = numberVariable.ToString(format string goes here);
I'll leave you to look up format strings in MSDN.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
hi everybody
i have a database named 'example',which is created in sql server 2000
now i want to convert it into msaccess 2007 through C# coding
hope you help me in this issue
thnx in advance
nagendra kumar
|
|
|
|
|
Generate a lot of inserts and execute them with a dataAdapter...
|
|
|
|
|
I need to create control that accepts rtf and draws it. Problem is that drawstring takes only regular text and I cant find anywhere how to draw rtf. Any sugestions are welcome and appreciated...
|
|
|
|
|
draw rtf
Have a look at 'RichTextBox' (that's a standard control)
|
|
|
|
|
Yes I know about richtextbox.. and load and save rtf etc. Please read post again. I need to draw rtf on user control. But thanks anyway.
|
|
|
|
|
You'll have explain a bit better what you mean with 'draw rtf'.
I don't really see the point in actually painting the text onto a usercontrol when the richttextbox (that you can drop onto a usercontrol) would accomplish all this for you. (if you don't want users to alter the text just set it to disabled or read-only)
|
|
|
|
|
Try using RichTextBox.DrawToBitmap, then rendering the bitmap. It's not perfect (it only draws the borders of embedded images), but suffices for a managed solution. I think you could use a method which draws a window (and by extension, control) image to a HDC, but I can't remember the name right now
|
|
|
|
|
Hi,
Conceptually OK, however a few days ago I learned RichTextBox.DrawToBitmap() does not really work.
I solved that by creating my own method, based on FormatRange, see here[^].
|
|
|
|
|
That's very clever. Did you print to another HDC instead of the one given by PrintPageEventArgs, or use another method?
|
|
|
|
|
public void DrawToBitmap(Bitmap bitmap) {
RECT rectToPrint;
rectToPrint.Top = 0;
rectToPrint.Bottom = (int)(bitmap.Height*anInch);
rectToPrint.Left = 0;
rectToPrint.Right = (int)(bitmap.Width*anInch);
RECT rectPage;
rectPage.Top = 0;
rectPage.Bottom = (int)(bitmap.Height*anInch);
rectPage.Left = 0;
rectPage.Right = (int)(bitmap.Width*anInch);
Graphics g=Graphics.FromImage(bitmap);
IntPtr hdc = g.GetHdc();
FORMATRANGE fmtRange;
fmtRange.chrg.cpMax = -1;
fmtRange.chrg.cpMin = 0;
fmtRange.hdc = hdc;
fmtRange.hdcTarget = hdc;
fmtRange.rc = rectToPrint;
fmtRange.rcPage = rectPage;
IntPtr res = IntPtr.Zero;
IntPtr wparam = IntPtr.Zero;
wparam = new IntPtr(1);
IntPtr lparam= IntPtr.Zero;
lparam = Marshal.AllocCoTaskMem(Marshal.SizeOf(fmtRange));
Marshal.StructureToPtr(fmtRange, lparam, false);
res = SendMessage(Handle, EM_FORMATRANGE, wparam, lparam);
Marshal.FreeCoTaskMem(lparam);
g.ReleaseHdc(hdc);
}
|
|
|
|
|
First of all I want to thank you all for replying to this topic... But disscusion went in te wrong way.
What I wanted is not any use of richtextbox, but method similiar to Graphics.Drawstring method that takes rtf instead of string and paints it on user control. Since there is no provided splution I guess I have to try to wirte some kind of parser that takes tekst and formating for it an use Graphics.Drawstring method...
|
|
|
|
|
|
Ok, thanks for the links. I'll take a closer look at ITextDocument.
|
|
|
|
|
I'm trying to build a custom control and I'd like to access some funcionalities of ClientScriptManager defined as internal on System.Web.UI
Here is a sample code:
namespace MyWebControls {
public class MyGridView : System.Web.UI.WebControl.GridView {
...
protected internal virtual MyMethod(object pLiteral) {
...
var vLiteralName = ClientScriptManager.GetScriptLiteral(pLiteral);
...
}
...
}
}
I've tryied also:
var vLiteralName = this.Page.ClientScript.GetScriptLiteral(pLiteral);
The functionality exists but is defined as internal. How can I access it?
Maybe some property on the Assembly. Change the namespace. I've tryied several things.
Please give me some light.
Thanks.
|
|
|
|
|
If the function you're trying to access is marked internal, it's only accessible from within the same module:
From HELP:
The internal keyword is an access modifier for types and type members. Internal types or members are accessible only within files in the same assembly.
A common use of internal access is in component-based development because it enables a group of components to cooperate in a private manner without being exposed to the rest of the application code.
For example, a framework for building graphical user interfaces could provide Control and Form classes that cooperate using members with internal access. Since these members are internal, they are not exposed to code that is using the framework.
It is an error to reference a type or a member with internal access outside the assembly within which it was defined.
|
|
|
|
|