|
Figured it out. The quick answer is to simply fill the dataset again. However, if you have any filters elsewhere on the form that use the same dataset, be prepared to deal with exceptions. You must put some data back into the dataset before any calls to the filter are made. This was a big issue for me and took me about 8-10 total hours of debugging to figure out. Then again, I am a complete noobie.
|
|
|
|
|
Glad you figured it out. But you may want to take a look at Update Controls .NET. These controls update themselves from your own data objects, not from datasets. So when you add your customer object to your list, it would automatically refresh the drop down.
|
|
|
|
|
Thanks for the link. I have checked it out and I will at least experiment with some of those controls.
|
|
|
|
|
Hi --
I'm building a GUI application in Visual C++ 2003 using the drag-and-drop Windows Forms toolbox. Does anyone know a way to build docked windows/forms (tabbed windows) into an application? I'm aiming for a look similar to the docked windows in, for example, visual studio.
Thanks in advance!
Kim
|
|
|
|
|
|
These are great controls. I have used them in the past and they are very easy to work with.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
How do they work with Visual c++.net (2003 or later).
Thanks,
Kim
|
|
|
|
|
I have only used them from C#, but if you are doing managed C++ development they should work the same way. I have used them in VS2003 and VS2005 and both have worked great.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
As Richard pointed out, the controls from Divelements are great. They have a very simple programming model and a polished look to them.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
|
You could also take a look at DotNetBar[^]. They are very good, plus they support a wide variety of styles.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi,
I am developing a software for winforms in VS 2005, but the GUI design is done by someone else. I can't let the designer to enter my source code for many reasons. Is there any tool that I can use to design my GUI without accessing the code ?
Thank you,
Yuval
|
|
|
|
|
You can use visual inheritance.
The designer change the base forms that your code inherit.
Any changes to base forms (that contain no code) will reflect to your child forms.
|
|
|
|
|
This is exactly what WPF was designed to solve. Have a look at WPF and XAML.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
i want to bind datagried with an array list full by objects ?
|
|
|
|
|
The easiest way to bind a data grid with an array list (or any object container, for that matter) is to use Update Controls .NET. You can drop an UpdateGrid on your form and implement the GetItems event. This event just returns the array. Then implement GetCellValue to get the values to display. When the user changes a value, the control fires SetCellValue.
Here's an example:
private System.Collections.IEnumerable itemsGrid_GetItems()
{
return _order.Items;
}
private object itemsGrid_RowAdded()
{
return _order.NewItem();
}
private void itemsGrid_RowDeleted(object tag)
{
_order.DeleteItem((Item)tag);
}
private UpdateControls.Forms.ColumnDefinitions itemsGrid_GetColumns()
{
return new UpdateControls.Forms.ColumnDefinitions().
Add("Name", typeof(string)).
Add("Price", typeof(decimal)).
Add("Quantity", typeof(int)).
AddReadOnly("Total", typeof(decimal));
}
private object itemsGrid_GetCellValue(object tag, int column)
{
Item item = (Item)tag;
if (column == 0)
return item.Name;
else if (column == 1)
return item.Price;
else if (column == 2)
return item.Quantity;
else
return item.Total;
}
private void itemsGrid_SetCellValue(object tag, int column, object value)
{
Item item = (Item)tag;
if (column == 0)
item.Name = (string)value;
else if (column == 1)
item.Price = (decimal)value;
else if (column == 2)
item.Quantity = (int)value;
}
|
|
|
|
|
Hello,
Please provide me some inforamation on how windows grapics system and mouse movement is mapped to each other? When we create a GUI using MFC how the mouse movements and MFC control gets mapped?
Plz help me
thanks in Advance
Bil
|
|
|
|
|
[modification @ 10:12 Monday 26th February, 2007]
Moved to the C# forum:
http://www.codeproject.com/script/comments/forums.asp?forumid=1649&select=1912526#xx1912526xx[^]
[/modification]
I am implementing a custom IExtenderProvider derived class so I can dynamically set the following properties on a control:
Required (using an ErrorProvider)
Description (ToolTip)
Errors (using an ErrorProvider)
Caption
I have everything working except for the caption. Ideally, I would like to add a Label control to the form for the given UI element. I know how to draw the label text myself, but that doesn't give me any of the accessability features that I gain when using a label.
The problem I'm running in to is that I can get the label to appear at design time but not at run time. Essentially, when I detect that a new control has been added I try to add a new label control (positioned appropriately) to the parent's Controls array. This works fine at design time but at run time the Parent property of the control I'm extending is null.
I'm trying to do this using an IExtenderProvider so I don't have to create subclassed versions of the UI controls to add a caption. In case you want the background, the project I'm working on needs to allow a dynamically rendered UI based on various pieces of meta data contained in the business object. The business object can be customized by the end-user through an admin interface, so I will never know what fields will be present and what their captions should be until it is time to actually render the screen.
Has anybody done anything similar to this? I've pretty much exhausted the information available on Google, which isn't much beyond creating a simple provider.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Scott
Sorry that it has taken so long to get back to you, but the way to do this is fairly straight forward. In your Set... method, add a handler for the ParentChanged event like this:
txtItem.ParentChanged += new EventHandler(txtItem_ParentChanged); Then, your method will look like this:
void txtItem_ParentChanged(object sender, EventArgs e)
{
TextBox control = sender as TextBox;
string labelText = Get...(control);
LabelExtender(labelText, control);
} Finally, create a method for the label extender:
private void LabelExtender(string labelText, TextBox txtBox)
{
Point loc = txtBox.Location;
Label label = new Label();
label.Name = string.Format("label{0}", Guid.NewGuid().ToString());
label.Location = loc;
label.Text = labelText;
label.AutoSize = true;
label.TabIndex = 0;
label.Size = new System.Drawing.Size(35, 13);
label.Visible = true;
if (txtBox.Parent != null)
{
txtBox.Parent.Controls.Add(label);
}
txtBox.Left += label.Width;
if (txtBox.Parent != null)
txtBox.Parent.Invalidate();
}
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Pete,
No worries. Since this forum is still rather new, I wasn't sure if it has the same amount of regular "readership" as the other forums.
Between your post and Mike's posts in the other forum I was able to get everything working. (That's actually why it has taken so long to respond...I've been heads-down coding the last two days.)
Your post did point out to me that I was missing an event handler for when the extended control's parent changes, which I have added. Now that everything is working and getting the finishing touches tomorrow, I'm going to ask if I can do an article on this (at least a slimmed down version), which I don't think I should encounter any objections.
Thanks,
Scott.
-----------------------------
In just two days, tomorrow will be yesterday.
|
|
|
|
|
Cool - I'll look forward to seeing your article.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I am working now on a windows application I have a large number of documents which is suppose to be archived in a folder but the archiving of the documents is to be hidden something like a PST file created for the outlook (store the mails and the attachments). The same way I need to store all the documents I upload using the application.
Will be better if I could have a clue at the earliest.
Thanx in advance.
-- modified at 0:09 Thursday 22nd February, 2007
Regards,Siva
|
|
|
|
|
Hi,
I'm writing an application supporting MDI. In http://www.codeproject.com/useritems/System_File_Association.asp is described how to associate the documents with my program.
I'm still looking for a method to load additional documents into the application via double-clicking the respective file. With MFC this was done using DDE, but DDE doesn't seem to be supported well in .net.
What is the standard way to achieve this in .net?
TIA,
Matthias
|
|
|
|
|
The closest thing to a ShellExecute is this code:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "yourfile";
p.StartInfo.UseShellExecute = trure;
p.Start();
p.Close();
Hope that helps.
Ben
|
|
|
|
|
See here[^] for an example.
Note that you can always use the WM_COPYDATA message to pass an arbitrary block of data between processes, so the use of the registry is not necessary.
|
|
|
|