|
Hello!
Please, I need help by solving two problems regarding the new DataGridView control.
Here is my simple example code:
// ==================== SNIP ====================
using System;
using System.Collections;
using System.Windows.Forms;
// Add a DataGridView named dataGridView1 to Form1.
namespace DataGridTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Create an Order list...
IList order = new ArrayList();
order.Add(new Item(1, "Keyboard", 1, "http://www.keyboard.com/"));
order.Add(new Item(2, "Mouse", 1, "http://www.mouse.com/"));
order.Add(new Item(3, "Monitor", 2, "http://www.monitor.com/"));
// Add a Button column...
DataGridViewColumn col = new DataGridViewButtonColumn();
col.HeaderText = "Link";
col.Name = col.DataPropertyName = "URL";
dataGridView1.Columns.Add(col);
// And fill the DataGridView...
dataGridView1.AutoGenerateColumns = true;
dataGridView1.DataSource = order;
}
}
// Instances representing Order items
class Item
{
private int id;
private string description;
private int quantity;
private string url;
public Item(int i, string d, int q, string u)
{
id = i;
description = d;
quantity = q;
url = u;
}
public int Id { get { return id; } }
public string Description { get { return description; } }
public int Quantity { get { return quantity; } }
public string URL { get { return url; } }
}
}
// ==================== SNIP ====================
1.
How can I achieve that the user can sort the table by clicking the sort glyph of a column? (In the old DataGrid control that works by default.)
2.
The button cells should all show a text like "Link...". But programmatically I need to get the URL value of each cell and not the displayed text. Is that possible?
Numerous thanks for all advices.
Regards,
Amd Opteron
|
|
|
|
|
I've not used this control, still in VS 2003 but it seems to me that you need to enable the 'AllowSorting' and 'AllowNavigation' properties of the grid. Presuming of course that this control has these properties!
Hope that helps!
Steve
|
|
|
|
|
1. Sorting is not automatically supported when binding lists. You will have to bind click events for the headers and sort the list manually (and do a refresh on the grid). With manually I mean using ArrayList.Sort with a defined comparer you have coded.
|
|
|
|
|
I have the folowing Problem:
I want to have a ListBox control which is able to display Text und a NumericUpDown control for each Item in the ListBox.
I don't know how to face this problem .
Should I extend the ListBox class and override the OnDrawItem() ???
Or start a new control from scratch ???
Any usefull hint is welcome.
|
|
|
|
|
I reckon this needs a new control. It also sounds like a convoluted UI.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
It is clearly mentioned in the installation document that WSE 2.0 can not be installed on later versions of .net 1.1.
So can i assume that the WSE 2.0 is built in in .Net 2.0 or i have to use WSE 3.0 to work with .net 2.0.
can any body give me a brief explanation.
ThanX in advance.
Ramesh.Kanjinghat
|
|
|
|
|
WSE 3.0 must be installed (i'ts an add-on, not part of the basic framwork). You might want to consider using WCF (winfx/.Net3.0) instead, since it is much cleaner than WSE 3.0. .Net 3.0 is also an add-on to Net 2.0, and has a separate installer.
|
|
|
|
|
hi guys
i recently downloaded the Helix SDK for real. i want to embed a real media video on my application. could someone tell me how to do it?
vineet
|
|
|
|
|
It's very unlikely you'll come acrossed someone who has used the SDK. Your best source of information is the people who wrote the SDK. Try the forums or IRC on that site and you'll get a better answer. There's even a link on their home page called "Need Help?"!
-- modified at 8:59 Friday 4th August, 2006
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Guys,
I have a questions regarding visual studio .net. Few days back as usual I had a problem with my PC which led to format my PC, and it was the corrupted Page file. Despite of my effort for days I couldn't recover to windows. I felt really bad because I couldn't recover my projects on my PC. There were a lot of files I lost during this process. What I have done now is I have bought an external hard drive with good capacity. I was thinking a lot the line to leave my project files housed on this project. It was annoying when it came to working with Visual Studio.net; because it creates solution file and .suo(don't what this file is?) What I am looking in to is that if I can create a project on external hard drive rather then setting to the local drive on PC. If you can please guide me in achieving this, I will really appreciate it. Thanks,
|
|
|
|
|
When you start a new project, just set the location in the field provided!
Steve
|
|
|
|
|
Hello,
I would like to ask you about tool, which can generate documentation for projects in .NET 2.0 based on XML documentation files.
I know only an unofficial version of NDoc with support for .NET 2.0.
http://jonas.lagerblad.com/blog/?p=4
Maybe you know alternative to this tool?
Thanks in advance
Wojtek
|
|
|
|
|
Hi,
Sandcastle should help you. There is even an article[^] here on CodeProject for it which features a rudimentary GUI for this command line tool.
|
|
|
|
|
Hi,
thank you for help
|
|
|
|
|
hey folks,
is it possible to use a 2.0 dll in a 1.1 project?
i just created a vs 2003 project and tryed to add a reference to a .Net2.0 dll...unsuccessful
is there a way to realize my intention anyway?
thanks, bernd
|
|
|
|
|
|
such a crap!
and also no way to create something like a wrapper in 2.0 for 1.1? or something like a .tlb?
thx
|
|
|
|
|
Nope.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
haven't tried it but are you sure it isn't possible to enable COM registration in the 2.0 dll and then use it from 1.1 via COM interop?
Robert
|
|
|
|
|
I haven't done it myself either, but I think this is correct...
His app will start and load the 1.1 framework, if available(!), or under the latest version installed. When his component is finally created, no matter what interface is used to call it, it'll try to load under the version of the framework that is already running. If the component isn't compatible with it, it'll fail. You can't load two different versions of the framework into the same process. His component will have to run as a remote component in its own process since you can run two versions side-by-side, but in different processes. This, of course, will also come with a performance hit because of the cross-process marshaling.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You are right. I didn't think of the restriction of only having one framework version within the same process.
|
|
|
|
|
I compiled my project against .NET1.1 and run it currently on .NET2.0, so i thought i can load some 2.0-dll's dynamicly...still in testing state...
-- modified at 18:05 Saturday 5th August, 2006
ok, that does the job. i'm sure there are sometimes some compatibility isues in running my 1.1-App under 2.0 but this price i have to pay.
thanks guys
|
|
|
|
|
Can you put your 2.0 dll behind a web service?
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
hmm...a web service is not a realy alternative.
what i'm trying to do is using ironPython in .Net 1.1
it seems, i have to port the host application.
thanks
|
|
|
|
|
Hi All,
When using Win CE.NET platform (portable computer's operating system) how I can implement the CIPAddressCtrl () class, that is used in VC++ when using the desktop operating system like XP etc.?
Is there some equivalent class that can help me to implement the same class in Win CE.NET platform?
Do help me.... I will highly thankful to, u dear members of CP……….
Regards,
Frozen
|
|
|
|