|
That is exactly what I have been playing with since my previous message to the OP.
Problem is CellLeave fires before the data has actually reached the cell you either get null (for new cell) or the old cell content so there is no value to test against to tell if a jump should be made or not. CellValuePushed is only fired if VirtualMode is true. You cannot set CurrentCell in CellValidating or CellValidated because you get a StackOverflowException. I'm still playing around but this ain't easy.
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.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Have you tried using the CellValidating event? That's where I've usually done those sort of things after checking to make sure the cell value is valid.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
I've tried to do this in CellValidating , CellValidated and CellParsing . All three throw a StackOverflowException on the line that sets CurrentCell .
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.”
Why do programmers often confuse Halloween and Christmas?
Because 31 Oct = 25 Dec.
|
|
|
|
|
Yes, I see what you mean. It acts as if changing the value of CurrentCell triggers the events all over again.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
i am taking the system date as
DateTime.Now.Date
its giving diffetent values for diferent culture
6/5/2010 12:00:00 AM : for English(United State)
05/06/2010 00:00:00 : for English(United Kingdom)
I want my dates in '6/5/2010 12:00:00 AM' how to get date independent of regional settings
|
|
|
|
|
DateTime is just a long counting ticks IIRC - what you are seeing is just the string representation for the culture in question. Specify your own string format, culture or InvariantCulture.
PiebaldConsult will be here shortly with his ISO comments!
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
As Davey says, DateTime.Now just returns a time - it has no format. When you specify the output format, then you can use the current culture, specify a culture, or fix the format so that it is culture invariant.
Have a look here[^] - it shows all the various parts you can use to format your date.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
As others have pointed out, a DateTime is a region independent structure already. What you are talking about is using a format converter to control how it is displayed.
Before you look at setting the output of the date to be a particular format, I must ask you to consider how your application is going to be used; people have a specific local regional setting in place and generally expect their dates to be displayed in those formats - this can be critical because it has an effect on the understanding of the date. When I looked at your example, my first thought was that you were talking about the 6th of May because I am based in the UK, by displaying a different regional setting you have skewed my understanding of your data.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Ah, DateTime, a perfect source of confusion around the globe. You might want to read this[^]. It holds some cues, including a reference to the infamous ISO 8601.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
Thank you for your response. I have found out the solution .
I am setting my Application Culture at startup
Application.CurrentCulture = new CultureInfo("en-US");
|
|
|
|
|
I want to find the handle of parent window containing windowless content. Example of web page containing windowless content is http://www.metacafe.com. On this site video files is getting played in windowless mode i.e. the player is not a window but just an content embedded in some other window (host/parent window). I want to determine handle of this parent window. contrary to this on youtube, the area on which video runs, is in itself a window.
Using spy++, I can determine the hierarchy of window in the IE window and If i will follow this hierarchy I can reach to the host/parent window on metacafe. But I believe it would only be applicable to metacafe. There must be some site which will host windowless content in different windows hierarchy.
So, please let me know if anyone knows how to get window handle of parent/host window containing/hosting windowless content.
Regards
f
|
|
|
|
|
hi,
I have a big problem in building deffrent mode of my application, imagine that we have a project contans of 3 part, for example a,b,c.In part a some codes of b and c must not be compiled in compile time, for this i used #define preproc and now, i need to compile full project by defining a, b or c
there is a command which is csc.exe /define:[a|b|c]
but this command only compiles one file and make exe. Now is there any way to compile a project with defining ? of course not changing source codes!my project considers 1000 source files
|
|
|
|
|
Don't post the same question in the forums and QA - it duplicates work and annoys people.
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
You should take a closer look on MSBuild!
|
|
|
|
|
thank you, msbuild has no config for define purpose,has it? please type an example
|
|
|
|
|
You can execute the following command to use your specific #define variable.
For example:
msbuild /t:Rebuild /p:Configuration=Release /p:DefineConstants=YourDefineStatement YourSolution.sln
This will rebuild the specified solution. It will result in a release build with the YourDefineStatement specified as preprocessor define statement.
|
|
|
|
|
kasraa00098000 wrote: but this command only compiles one file and make exe
No, you can compile multiple files or produce a DLL. CSC is called by Visual Studio, so it can compile and produce anything VS can.
|
|
|
|
|
really? how can I compile a csproj file with csc? what about a group of cs file?
|
|
|
|
|
I know nothing about regex. I want to replace some charaters in a string.They are:
+ --> {+}
^ --> {^}
% --> {%}
{ --> {{}
} --> {}}
Who can give me the C# code? Thanks in advance.
|
|
|
|
|
Why do you have to use a regex? If you're not comfortable writing them and you don't have a complex pattern to parse, then don't bother. You can always use string.Replace instead which would do the job equally well. A lot of times, people are advised to use regular expressions when they don't add value, and it really is a case of using a sledgehammer to crack a nut.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Sometimes though, a regex is the right thing to use. String.Replace in this case is really nasty, partly because there are six cases, but mostly because two of the cases are included in the output of all six...
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
Perhaps something like this:
string inputText = "+{}^%";
// This is the search string
Regex regex = new Regex("[\\%\\{\\}\\^\\+]",RegexOptions.Compiled);
// This is the replacement string
string regexReplace = "{$&}";
// Replace the matched text in the InputText using the replacement pattern
string result = regex.Replace(inputText,regexReplace);
|
|
|
|
|
I tried. But...
I inputed:
\begin{equation}
y&=x+z;
m&=[s]^2%4
\end{equation}
The result was:
{+}{{}{}}{^}{%}
modified on Wednesday, June 9, 2010 7:26 AM
|
|
|
|
|
private void button1_Click(object sender, EventArgs e)
{
Regex regexWithAllPossible = new Regex(@"([\+\^%{}])");
string source = @"+ --> {+}^ --> {^}% --> {%}{ --> {{}} --> {}}";
string result = regexWithAllPossible.Replace(source, new MatchEvaluator(CheckMatch));
}
private string CheckMatch(Match m)
{
return "{" + m.Value + "}";
}
Did you know:
That by counting the rings on a tree trunk, you can tell how many other trees it has slept with.
|
|
|
|
|
The "-->" means "to"! Haha. Thanks.
|
|
|
|