I need some help on getting the intellisense to work in the editor for my custom control. I have a control had uses sup elements. Look like this. < Control > < / Control > I can't get the design time support working for the option elements like it works in the datagrid and other controls. I they have it I can have it too. So if anyone knows something about this. Please help me.
Matglas
Posts
-
design time element support [modified] -
set this object to nullI already thought so but did not directly find a way to set the parent on Deserialization. Or I have to Recursivly go through every object.
-
set this object to nullThis is the object situation. I copyed some code, to show you. The
DeletePage()
needs to delete the page from thePages
property in theDocument
.public class Document : ITreeView { public Document() { } private PageCollection _pages = new PageCollection(); [XmlElement(ElementName = "page")] public PageCollection Pages { get { return _pages; } set { _pages = value; } } #region public methods public Document Deserialize(string file) { //.. } public void Serialize(string file, Document doc) { //... } #endregion #region ITreeView Members public ContextMenu GetContextMenu() { ContextMenu docContext = new ContextMenu(); //... return docContext; } public ObjectTreeNode GetTreeNode() { return new ObjectTreeNode(this, "document", 0, 0); } #endregion } public class Page : ITreeView { public Page() { } #region properties //... #endregion #region ITreeView Members public ObjectTreeNode GetTreeNode() { return new ObjectTreeNode(this, "page " + _pagenumber, 0, 0); } public System.Windows.Forms.ContextMenu GetContextMenu() { ContextMenu pageContext = new ContextMenu(); MenuItem delItem = new MenuItem("Delete", new EventHandler(DeletePage)); pageContext.MenuItems.Add(delItem); return pageContext; } public void DeletePage(object sender, EventArgs e) { //delete this page } #endregion }
-
set this object to nullOk I hope my english is good enough to explain what I want to achieve. I have a deserialized object from a xml file. This object is shown in a treeview to edit the content. I want to have the option to remove a object by clicking on it and getting it context menu. This context menu is unique for every object. I get it by a GetContextmenu method that is implementated by a Interface. The eventhandlers for each menuitem is set to a method in that object. I hope the situation is clear. Otherwise i have to make some code to show it.
-
How to call a method in another .aspx fileWhat I did one time was create a interface with a execute method. Then add the interface to your page and then place a call to the Page_Load in the execute method. Then where you want to use is create a instance of the page and use the execute method. I hope this is usefull.
-
set this object to nullI will explain myself a bit.
public class A { public void SetToNull() { //this object is null //but how do you do this } }
I know that I can set it like this below. But that is not what i want.
public class A { public void SetToNull() { //this object is null //but how do you do this } } public class B { public A a = new A(); public void SetToNull() { a = null; } }
It needs to be like this.
public class A { public void SetToNull() { //this object is null //but how do you do this } } public class B { public A a = new A(); public void SetToNull() { a.SetToNull(); } }
-
set this object to nullI need some help on the following problem. I need to have a object set itself to null. Is this in any way possible?
-
Relate webcontrol to sister control in pageI want to build a webcontrol that has a reference to seperate controls on the page to manipulate them on pre-render. Does anyone know how to do this. Because I can not find any articles about it.
-
Next & Previous.I see this discussion is to crazy for words. I am Dutch and my Englisch is not too good when I write. So thanks for all the support on decrypt my spelling. And now we know that you can write nop, noop or noob.
-
Next & Previous.Possibly a UI noop.
-
Calling a Method in C#C# is case sensative. Make sure logon is Logon when the method had capital letters.
-
LinkButton click event in custom web controlThanks I'll try it tomorrow when I am back at work. Matglas
-
LinkButton click event in custom web controlThis is my code. When creating the child controls I add a linkbutton that has is linked to method viewLogLButton_Click(). But this method does not not execute. I deleted some original code because it was a lot longer.
[ToolboxData("<{0}:ExceptionViewer runat=server />")] [DesignTimeVisible(true)] public class ExceptionViewerControl : WebControl { protected override void RenderContents(HtmlTextWriter output) { this.EnsureChildControls(); this.RenderChildren(output); } protected override void OnInit(EventArgs e) { } protected override void CreateChildControls() { this.Controls.Clear(); HtmlTable RenderTbl = LoadLogDirectory(); this.Controls.Add(RenderTbl); } private const string mainTblId = "exViewerTbl"; private String fileLoad = null; private HtmlTable _mainFileTable = new HtmlTable(); private HtmlTable MainFileTable { get { return _mainFileTable; } set { _mainFileTable = value; } } private HtmlTable LoadLogDirectory(FileInfo file) { this.MainFileTable = new HtmlTable(); LinkButton viewLogLButton = new LinkButton(); viewLogLButton.CommandName = "ViewLogFile"; viewLogLButton.CommandArgument = file.Name; viewLogLButton.Text = file.Name; viewLogLButton.Click += new EventHandler(viewLogLButton_Click); ControlCollection controls = new ControlCollection(this); controls.Add(viewLogLButton); if (fileLoad == file.Name) { //action } this.MainFileTable.Rows.Add(GetHeaderRow(controls)); return MainFileTable; } void viewLogLButton_Click(object sender, EventArgs e) { fileLoad = ((LinkButton)sender).CommandArgument; } private HtmlTableRow GetHeaderRow(ControlCollection controls) { //header cell HtmlTableCell headerCell = new HtmlTableCell(); headerCell.Attributes["class"] = styleClass; headerCell.Attributes["colspan"] = span.ToString(); foreach (Control ctrl in controls) { headerCell.Controls.Add(ctrl); } headerRow.Cells.Add(headerCell); return headerRow; }
-
LinkButton click event in custom web controlI am working on a webcontrol that contains linkbuttons and I have to act on the click event of them. Can anyone help me to do this. I can not get it to work. Matglas
-
Review a websiteHere's my review. - First of all let someone make a stylish flash for you. The black hole stairs at me. - Center the everything. - Look at your css in IE and Firefox. (thin solid border is different from 1px solid border). - Give some padding on your tekst cells. So the text is better to read. This is my opinion. Do with it what you want.
-
Don't try coding with voice recognitionIt even does not work with simple speach if you look at the presentation of microsoft. Terrible. There are some other clips at Youtube too about it. Great stuff.
-
how to get first 5 records from a dataset having 100 recordsI know that when you have a sql statement MySql support Limit 5. Then you get 5 records. But i dont know if all the database applications support it. Hope it helps.
-
Don't try coding with voice recognitionThe guys here at work started to ask where all that noise was coming from. I could not stop laughing. To good. Thanks you.
-
Is anyone else....The biggest problem of MS is that there things are implemented on so many places that sometimes you just have to work with it. And I thought why dont make the best of it. Creating custom controls does give the most problems. Many times the designer crashes and then the everything wants to stop working. Maybe something like this would work better. Nice implementation of the IDE.
-
Is anyone else....Keep me posted on your own IDE. Love to see the result ;)