|
me too. I have a project but It's don't work in this case.
|
|
|
|
|
|
thanks a lot ravi
its working
|
|
|
|
|
you are always welcome.
|
|
|
|
|
|
Is this a question?
Or is this an instruction?
If the former, then you forgot to include the bit explaining what your problem is.
If the later, you forgot you are not my employer.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
actually i struck in implementing site map by using recursion concept.
i need to develop user control for sitemap by using recursion if you have idea on that please let me know.
thanks.
|
|
|
|
|
What have you tried?
How far have you got?
Where are you stuck?
Sorry, but without these it is difficult to be at all specific!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
|
Couple of things:
1) When you post code fragments, use the "code block" widget not the "inline code" (That way you get <pre> tags instead of <code> tags. This preserves your formatting
inline code:
string SubUlHTML = "";<br />
if (node.HasChildNodes)<br />
{<br />
SubUlHTML = "<ul>";<br />
foreach (SiteMapNode childnode in node.ChildNodes)<br />
{<br />
SubUlHTML += GetNodeHTML(childnode);
code block:
string SubUlHTML = "";
if (node.HasChildNodes)
{
SubUlHTML = "<ul>";
foreach (SiteMapNode childnode in node.ChildNodes)
{
SubUlHTML += GetNodeHTML(childnode); Which would you rather read?
2) Looping isn't recursion. Recursion: See "Recursion".
For example: Factorials
In mathematics, the factorial of a positive integer n, denoted by n!, is the product of all positive integers less than or equal to n. For example,
5! = 5 x 4 x 3 x 2 x 1
0! is a special case that is explicitly defined to be 1.
Another way to write that is n! = n * (n-1)! while n > 1
To code this:
private int Factorial (int n)
{
if (n < 0)
{
throw new ArgumentException("Factorial not defined for negative numbers");
}
if (n == 0)
{
return 1;
}
return n * Factorial(n - 1);
}
Do you see the difference between that an a loop? If not, think about it. This is important!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
Correct me if I'm wrong but are you not putting yourself in an infinite loop in your Factorial method?
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Consider yourself corrected!
private int Factorial (int n)
{
if (n < 0)
{
throw new ArgumentException("Factorial not defined for negative numbers");
}
if (n == 0)
{
return 1;
}
return n * Factorial(n - 1);
} If you call it with 3:
Factorial(3)
Calls Factorial(3 - 1): Factorial(2)
Calls Factorial(2 - 1): Factorial(1)
Calls Factorial(1 - 1): Factorial(0)
Which returns 1. You can add another special case @ either 2 or 1, but it looks clumsy for this example. Let's be honest, I wouldn't implement factorial this way in the real world anyway; it is just the classic example and easy to understand what is going on.
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
My bad, I stand corrected
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
You should go through the bottom section of this[^] once before asking a question on a forum.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
Has anyone used rdpsign.exe with c#? Any compatibility issues with .net 3.0 or 3.5?
Any idea where I can download it? Or does anyone have a copy they can attach to the forum (as long as there is no TOS being violated)?
I have the 2008 enterprise iso file, but I do not find it inside of the iso?
Thanks!
|
|
|
|
|
There's no download for it as far as I can tell. It comes with Windows Server 2008 and maybe 2003 also. I don't have either here to verify that. You may have to install Terminal Services on the server to get it.
|
|
|
|
|
Hi,
Thanks for the reply Dave, I need it for server 2k3 and did not find it on my servers. I found it on my win7 disk so I decided to put it online for others, since finding this was so difficult.
http://www.filedropper.com/rdpsign[^]
I can provide hashes for this in case anyone wants, but rest assured this is straight from my win7 ultimate disc, which is 32 bit.
My only problem now is that I can't test it because I only have xp installed at home ... ugh! And I don't feel like installing win7 tonight.
modified on Tuesday, January 4, 2011 10:47 PM
|
|
|
|
|
|
The question is:
How to get current cell type? i got a loop like this:
foreach (DataGridViewRow row in dgv.Rows)
{
foreach (DataGridViewCell cell in row.Cells)
{
String HeaderName = cell.OwningColumn.HeaderText;
}
}
So the question is, how do i get a cell type, for example, is it combobox cell type, or textbox cell type, or button cell type, or checkbox cell type? Or, in other words, do my current processing cell belongs to a column of type DataGridViewComboBoxColumn or DataGridVieTextBoxColumn, or DataGridViewButtonColumn?
thanks
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
Try getting the type of the cell.OwningColumn and see what you get. Something like:
switch typeof(cell.OwningColumn)
|
|
|
|
|
Alright, thanks for the hint.
Actually, it was pretty much straightforward:
if(cell.OwningColumn is DataGridViewButtonColumn) then...
thanks
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
if you're interested in one or two types only, you could use the is keyword to your advantage, as in:
if (cell.OwningColumn is DataGridViewCheckBoxColumn) { ... }
if (cell is DataGridViewCheckBoxCell) { ... }
|
|
|
|
|
Yup, thats it, just figured it out second ago, but thanks
011011010110000101100011011010000110100101101110
0110010101110011
|
|
|
|
|
Is there an easy way to utilize some diagnostic class/method in a manner similar to the MFC ASSERT macro in that I will be taken to the location of the assertion failure in the code while debugging.
This would be more helpful/quicker than trying to embed hints on the location in the Debug.Assert message string. I checked my books and the MSDN documentation but I have not been lucky enough to trip over any alternatives yet.
|
|
|
|
|
The closest you're going to get is to check for the condition using a normal If statement, then call Debugger.Break.
Read up on this page[^] for some ideas to implement what you want.
|
|
|
|