|
|
Sorry, but the ploblem is not with the serialization, is loading the data.
The error always says that is not possible to load the assembly.
Any way, thank you
|
|
|
|
|
billy_iii wrote: No. I can load my assembly.
billy_iii wrote: the ploblem is not with the serialization, is loading the data.
Now which way is it?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I have a winforms application (C# 2008 Express Edition), and I want the user to be able to drag and drop the columns to a different position in the DataGridView.
The DataGridView is unbound, and is populated with data on opening of the form, the columns are programmatically set.
I have "AllowUserToOrderColumns" set to true, but i can't reposition the columns.
Is it possible to reposition columns, and if so how do I accomplish this.
TIA,
Rob
|
|
|
|
|
|
Paw Jershauge wrote: Try display this in the PropertyGrid.
I've tried using your code, and it seems to work;
public partial class MainForm : Form
{
PropertyGrid grid = new PropertyGrid();
Demo myDemo = new Demo();
public MainForm()
{
InitializeComponent();
grid.Dock = DockStyle.Fill;
grid.SelectedObject = myDemo;
Controls.Add(grid);
}
}
public class Demo
{
[Category("Behavior")]
public int Total
{
get;
set;
}
} Are you inheriting from Object , as the snippet suggests?
I are Troll
|
|
|
|
|
What kind of OS er you using ??? also Windows 7 64bit ???
I have made a screendump. take a look here ScreenDump
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Paw Jershauge wrote: What kind of OS er you using ??? also Windows 7 64bit ???
Windows XP, 32 bit. I'm getting a category-heading as expected, both with .NET 3.5 as with 4.0.
Is it only reproducable on 64-bit Weven?
I are Troll
|
|
|
|
|
|
Paw Jershauge wrote: Dont know, will look into it tomorrow on work... but its kind of funny dont you think ?
That it is - I'm curious what caused it.
Paw Jershauge wrote: i have asked microsoft, but still no answer...
Over Microsoft Connect?
|
|
|
|
|
Yes over Connect... the reason I posted it here, was to see if others had the same experience.
When i get the answer i will post it here.
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Just a short follow up: The same happens on a Vista 64 bit.
So the error/bug is now confirmed on the following OS:
- Windows 7 (64 bit)
- Vista (64 bit)
Its running correctly on (No bug):
- Windows 7 (32 bit)
- Vista (32 bit)
- Xp (32 bit)
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Thanks, good to have a future reference
I are Troll
|
|
|
|
|
Ok so heres the real bug, although its not really a bug, its more a culture thing.
When running the propertygrid in the danish language, the following CategoryAttribute will be translated:
Category("Appearance") = Udseende
Category("Behavior") = Type (the correct word for this would be "adfærd" or "opførsel" and NOT Type)
Category("Data") = Data
Category("Font") = Skrifttype
Category("List") = Oversigt (the correct word for this would be "List" or "Liste" and NOT Oversigt)
Category("Misc") = Diverse
Category("Position") = Placering
Category("Scale") = Skalering
Category("Text") = Tekst
I didnt consider the culture thing because translating Behavior to danish is not Type
I've posted the information on my blog here: C# and I[^]
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
Cool, good to have it logged. Let's hope it'll be rectified in the next update
I are Troll
|
|
|
|
|
Well I found since I just downloaded the VS 2010 RTM, that its corrected in the framework 4.0, but having thats said, I dont know if danish version will be corrected... hehe lets see when that come out.
With great code, comes great complexity, so keep it simple stupid...
|
|
|
|
|
|
The first thing that comes to mind. Store the connection string in a config file.
"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
|
|
|
|
|
Have you considered a Web Service?
|
|
|
|
|
I guess I wasn't clear, this is a windows application not a web application !
|
|
|
|
|
That's OK, it can still use a Web Service. Perhaps look into Windows Communication Foundation.
|
|
|
|
|
Hi.
I want to create dvdplayer like CiberLink or WinDVD.
I can create sample player (run video file,show mediaposition,play,pause,stop,...) with IGraphBuilder,IMediaControl,IMediaPosition and so on. (directshownet)
But same dvdplayers have more functionality , for example, fast forward 32x,16x,... , fast backward -32x,-16x,...
How i can create dvdplayer with directshow?
How to use IDvdGraphBuilder and IDvdControl2 ?
If you have some code sample or link, please link it me.
Many Thanks!
We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Hi ,
suppose I have a class that draws an image on panel on Form1. How do I dynamically create a number of panels on a Form1, each containing a drawing derived from graphics class and at the same time change properties of each image seperatly.
modified on Tuesday, April 6, 2010 2:43 PM
|
|
|
|
|
You can add panels dynamically to a form by doing something similar to the following:
Form parentForm; // Set this to the form you want the panels added to
foreach(var drawing in Drawings)
{
MyCustomPanel myPanel = new MyCustomPanel();
myPanel.Drawing = drawing;
parentForm.Controls.Add(myPanel);
}
The trick here is to create a custom control derived from panel that will paint the drawing you assign to it. Here's a basic skeleton to get you on the way
public class MyCustomPanel: Panel
{
public Drawing Drawing { get; set; }
protected override void OnPaint(object sender,PaintEventArgs e)
{
}
}
|
|
|
|
|
Here is my code:
Class for drawing different shapes (selected by iSelectShape):
public class ShapeDrawing
{
private int iSelectShape = 1;
public int SelectShape
{
get { return iSelectShape; }
set { iSelectShape = value; }
}
public void DrawShape(Graphics g)
{
Rectangle r = new Rectangle(new Point(0, 0), new Size(100, 100));
switch (iSelectShape)
{
case 1:
g.DrawEllipse(Pens.Black , r);
break;
case 2:
g.DrawRectangle(Pens.Black, r);
break;
}
}
}
Custom panel class:
public class MyCustomPanel : Panel
{
public ShapeDrawing Drawing { get; set; }
protected override void OnPaint(PaintEventArgs e)
{
if (Drawing != null)
Drawing.DrawShape(e.Graphics);
}
}
And main form with one panel:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
ShapeDrawing shape1 = new ShapeDrawing();
myPanel.Drawing = shape1;
shape1.SelectShape = 2;
}
private void myPanel_Paint(object sender, PaintEventArgs e)
{
}
}
and InitializeComponent
private void InitializeComponent()
{
this.myPanel = new Dynamic_controls_panel.MyCustomPanel();
this.SuspendLayout();
this.myPanel.BackColor = System.Drawing.Color.White;
this.myPanel.Drawing = null;
this.myPanel.Location = new System.Drawing.Point(0, 0);
this.myPanel.Name = "myPanel";
this.myPanel.Size = new System.Drawing.Size(301, 331);
this.myPanel.TabIndex = 0;
this.myPanel.Paint += new System.Windows.Forms.PaintEventHandler(this.myPanel_Paint);
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(416, 459);
this.Controls.Add(this.myPanel);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);
}
#endregion
private MyCustomPanel myPanel;
Now I want to add number of panels with shape drawings dynamically with click on the button and select shape wich shall be drawn on each panel. Form will also contain remove button, so I can remove any selected panel ...
modified on Wednesday, April 7, 2010 1:05 AM
|
|
|
|