|
|
Hello Mahesh,
Before I forget, "waana" is not an english word.
ksss_maheshece wrote: include that file in my webfrom
Not sure what that means but perhaps you want to have an XML Data Island.
|
|
|
|
|
led mike wrote: Not sure what that means but perhaps you want to have an XML Data Island.
Shouldn't that be "waana have an XML Data Island"?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What up!
Hey while I have your attention, what's the deal with the HOW TO ANSWER A QUESTION? Does it mean the monkeys have taken control of this site and I am no longer welcome?
|
|
|
|
|
led mike wrote: what's the deal with the HOW TO ANSWER A QUESTION?
Beats me. I voted to have it removed
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I voted to have it removed
No you didn't, in this forum anyway. I just did!
So I guess I'll see how it goes but I may have to stop using CP because I'm not inclined to put up with any monkeyshit.
No I just changed my mind, stuff it, I'm outahere. Good luck dude, it's been fun.
modified on Wednesday, July 22, 2009 12:58 PM
|
|
|
|
|
Hi,
I use the XmlSerializer and I'm looking for a way to set the default XML namespace on the top level Element. The correct way to do this, I hoped, was to specify this in an XmlType attribibute on the top level class. However, the namespace is only applied to the children of this class. For example, see the C# code below that serializes a simple nested structure:
public class Circle
{
}
[XmlType(Namespace="http://mbshapes.com")]
public class Shapes
{
private Circle _circle = new Circle();
public Circle Circle
{
get
{
return _circle;
}
set
{
_circle = value;
}
}
}
public class SerializeTest
{
public static void Serialize()
{
Shapes shapes = new Shapes();
using (TextWriter textWriter = new StreamWriter("Shapes.xml"))
{
XmlSerializer xmlSerializer = new XmlSerializer(typeof(Shapes));
xmlSerializer.Serialize(textWriter, shapes);
}
}
}
The output is this:
<?xml version="1.0" encoding="utf-8"?>
<Shapes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Circle xmlns="http://mbshapes.com" />
</Shapes>
What I expected (and what I need), is something like this:
<?xml version="1.0" encoding="utf-8"?>
<Shapes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://mbshapes.com">
<Circle />
</Shapes>
Am I doing something wrong? Or are there any work-arounds?
Thanks.
|
|
|
|
|
Try
[<code>XmlRoot</code>(Namespace = "http://mbshapes.com")]
public class Shapes
{
private Circle _circle = new Circle();
public Circle Circle
{
get
{
return _circle;
}
set
{
_circle = value;
}
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That worked, thank you very much !
|
|
|
|
|
actually i am making a website,i have a problem with break point.
Following solution is not suitable for me because i am not gatting project menu.
project-> property->build
tell me the solu tion if u have please.
|
|
|
|
|
Check it here ![^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
I have datagridview control and one of its column I hav added DataGridViewLinkColumn.
If I click DataGridViewLink of any particular row of datagridview I want to change dynamicaly the Text property of DataGridViewLinkColumn for that Row only.
my code is like this
//I have set DataGridViewLinkColumn.Text="view" in design property
DataGridViewLinkColumn.Text="view"
//after clicking the link I want to change the text of link for that row only
DataGridViewLinkColumn.CurrentRow.Cells[2].Value="hide"
but problem is that text remain unchanged.
I dont want "view" ,I want "hide"
can any one guide me plz in c# and window application
regards
tarak
|
|
|
|
|
Try using the Value property of the cell instead of the Text property of the column. Maybe not the best answer, but it produces the behaviour I think you're after.
Like so...
private void Form1_Load(object sender, EventArgs e)
{
DataGridViewLinkColumn col = new DataGridViewLinkColumn();
dataGridView1.Columns.Add(col);
for (int i = 0; i < 4; i++)
{
DataGridViewRow dr = new DataGridViewRow();
dataGridView1.Rows.Add(dr);
}
for (int i = 0; i < 4; i++)
dataGridView1.Rows[i].Cells[0].Value = "view";
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "hide";
}
|
|
|
|
|
Hi ,
I have a problem with print in crystal report using VS2003.
[CODE]
CrystalRpt rptdoc = new CrystalRpt();
System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument);
rptdoc.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
rptdoc.PrintToPrinter(1, true, 0, 0);
[/CODE]
CrystalRpt is the crystalreport that I use.
when user clicks cancel in the print dialogbox that appears, it throws the error.
Please find the stack trace below:
************** Exception Text **************
CrystalDecisions.CrystalReports.Engine.InternalException: Error in File C:\DOCUME~1\RAKESH~1.RED\LOCALS~1\Temp\temp_d047ddc7-9297-4a24-a03f-11f21917120a.rpt:
Request cancelled by the user.
at .I(String , EngineExceptionErrorID )
at .D(Int16 , Int32 )
at .C(Int16 )
at CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
at SampleCrystal.Form1.btnPrint_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
********************************************************************************
**********
When I implement the same code using VS2008, i dont get the error.I found it specific in VS2003.
Thanks in advance.
Rakesh Reddy
|
|
|
|
|
Most people use 96 DPI, but occasionally people set this to 120 DPI (or even higher), especially with high resolution monitors that display at greater than 100 DPI. This number is easy to get under Win32 ("LogPixels") and I've done it for years. But I'm relatively new to .NET and haven't been able to find out what .NET API delivers this number. This is such an important parameter that there must be a simple API to get it under .NET. Does anyone know what it is? This is especially important from Vista onward which doesn't believe in physical pixels, but merely device independent units.
Matthew MacDonald's Pro WPF in C# 2008, chapter 1, has a good discussion of device independent DPI scaling but nowhere does he say how to obtain this crucial number. I need the number because I have to scale the numbers that come back from the monitor enumeration, which specifies, x,y, height, and width, to fill the screen with a bitmap. All these numbers have to be scaled back by a factor 96/x, where x is the DPI Scaling number.
If worse comes to worse, I'll use Interop services to get the number, but I cringe every time I do that, thinking that I've just missed something in .NET.
Addendum: I can also get this number from the Registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI]"LogPixels" but that's even more of a hack than Interop Services. The cleanest way would be through a .NET API.
modified on Monday, July 20, 2009 12:36 PM
|
|
|
|
|
Graphics g = this.CreateGraphics();
MessageBox.Show(g.DpiX.ToString() + Environment.NewLine + g.DpiY.ToString());
g.Dispose();
g = null;
this is a Form in the above snippet
|
|
|
|
|
Ah, I should have mentioned that this is a WPF application, not a Forms application. Last time I posted a question in the WPF forum I was castigated for posting a general .NET question in the wrong forum, when I thought it was a WPF question. Damned if you do and damned if you don't.
There are classes in WPF that return properties, DpiX and DpiY, such as BitmapImage, but those are the DPI x and y of particular bitmaps. I tried with a JPEG image I had lying around and it returned 300, which was a property of the bitmap, not the DPI Scaling number that the user has set up for his entire system.
I looked around and couldn't find a WPF equivalent to the CreateGraphics() call that your example gives.
Well, I guess I'll post my question on the WPF forum.
|
|
|
|
|
Hi,
I fail to see why
Bitmap bitmap=new Bitmap(100, 100);
Graphics gBM=Graphics.FromImage(bitmap);
Console.WriteLine("DpiX="+gBM.DpiX);
gBM.Dispose();
wouldn't work in a WPF app?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: I fail to see why...wouldn't work in a WPF app?
I believe it would if I was allowing my WPF application to interact with Windows Forms, but so far I've managed to "remain pure" and avoid all contamination with that superceded paradigm. I hope I'm not giving offense by characterizing Windows Forms that way. But it does seem clumsy and ad hoc compared to the regularity of WPF. The problem with WPF is that there are gaps in it: it was "rushed into print" before achieving functional closure. This is why I've had to resort to Interop facilities so much in my application. Hopefully .NET 4.0 will fill in the holes.
|
|
|
|
|
fjparisIII wrote: The problem with WPF is that there are gaps in it; ... before achieving functional closure
Have you read some of the "why WPF sucks today" messages that appear all over the Lounge? They made me postpone my first WPF encounter for a few years, since that is the time it normally takes Microsoft to get something from an available product or technology to a usable product or technology.
From what I've read, the problems are:
- there are more holes than there is cheese;
- half of it does not work;
- Visual Studio 2008/2010 crashes on all but the smallest WPF apps;
- Expression Blend crashes too.
So, yes I like the theoretical concepts of WPF, and I await better times.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: Have you read some of the "why WPF sucks today"
Until I'm blue in the face. Most of these people seem to be whiners that want to be hand-held through projects and are afraid of doing a little digging.
But I've got 80,000 lines of pure WPF code (and a smattering of Interop contamination) in my applications and my beta testers (advanced and professional photographers) love it. (I'm looking for active beta testers, BTW.)
The biggest problem I've had is working around puzzling limitations like why is the BackgroundWorker class an [STMThread] and not an [STAThread]. It prevents BitmapEncoder.Save() from executing without causing an arithmetic overflow exception, probably because the class instance can't be initialized under MTA. Inquiries to Microsoft land on deaf ears, but a lot of people have complained, so they know about this.
I finally had to resort to writing my own StaBackgroundWorker class that does the same thing as BackgroundWorker except it runs STA rather than MTA. If you're not willing to go the extra mile once in a while, then state of the art technlogies are probably not for you, or your company.
And Expression Blend is for sissies.
|
|
|
|
|
Very interesting. So there is hope.
Would you consider writing an article? Seems you could tilt the balance a bit on WPF...
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: Would you consider writing an article? Seems you could tilt the balance a bit on WPF...
I'm not sure. An article on what? I know, something on WPF, but in spite of what I've done the last 4 months, I'm far from a WPF expert. Just a coding (and, admittedly, a documentation) maniac. I constantly live out of books, MSDN, and Google searches, and am hardly authoritative.
|
|
|
|
|
IMHO an article that explains a real-life WPF application would be worthwhile; it doesn't have to be very technical, however telling about the components used, shedding some light on how they were used, what some of the problems and solutions were, etc. would encourage people to try and use WPF themselves. Of course there are some articles already, but yours seems a bigger, more realistic application, and it not being very high-tech may be a plus.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Maybe something when I'm out from under this current project. There are some interesting solutions I have in this application, like the way I save hundreds of configuration parameters in an XML file in the Users folder and totally avoid touching the Registry.
This application is based on an MFC CPropertySheet/CPropertyPage application that had about 10 tabs on it. I gave it away free to advanced and professional photographers all over the world. My current beta testers are largely taken from the owners of the original. Its reincarnation has much more professional polish and has about 70 different pages, which of course can't be arranged in a tabbed dialog. Instead its "menu" is a hierarchically organized tree control in a panel on the left with the pages displayed in a panel on the right.
modified on Monday, July 20, 2009 8:45 PM
|
|
|
|
|