|
Hi,
I need help from anyone.
I have a datagrid, in that one column (Check boxes) is created by using item template.
I have two buttons beside to datgrid.one is up and another is down.
now my task is, after selecting a record in the grid, If click on the up button record should be moved up, if I click on down button record should be moved down.For the first record up button shoud not work. For the last record doen button should not work.
Please send me the code.
Thanks in advance.
|
|
|
|
|
Hello
Pinnapureddy wrote: Please send me the code.
It's not approperiate to ask for how the answer is posted this way. Maybe you declare that code snippets are preferable, but almost no one will post you "The code"!!
Now, to your issue. There many approaches to solve it. One is to make a column at the begining of the grid. You may cal it "Order". Now make that column invisible and store the order you want the columns to appear with in these cells. Sort the Grid according to that column.
When the user clicks up, swap the order value of the selected row with the one above and resort. When the user clicks down vice versa.
Before changing the values, check if order = 0, or order = MaxValue. If so, return without doing anything.
Regards
|
|
|
|
|
hi,
Thank you for your reply.
|
|
|
|
|
Hi,
using VS2005;
I have successfully setup Crystal Reports but only if I create a new oledbconnection using the Crystal Reports Database selector.
When I select a table in the Database Selector from an available Project Data -> ADO.Net DataSets -> dataset -> table I can chose the columns etc BUT when I run the program the report only shows the column names and not the actual data.
I presume I need to load the data into the reportviewer but I can't figure out how and nor can I find any help here or on the net.
Glen Harvy
|
|
|
|
|
Hi All!
I try to understand and improve my application cold start.
I already load as little as possible in the Main().
Now I have a test which gives strange results, and I try to understand what it means.
test 1:
====
I reboot, launch a small .NET executable, which takes 7 seconds, and launch my application, which takes 30 seconds.
test 2:
====
I reboot, launch my application, which takes 70 seconds.
Now this doesn't add-up, why?
Any idea what's going on?
I'm thinking to write a small "QuickStart" application which "initialize" everything. How should it work?
|
|
|
|
|
Super Lloyd wrote:
Now this doesn't add-up, why?
That's probably because most of the .NET framework runtime code was loaded in the cache when you launched the first .NET application. That still doesn't explain the 40 second drop though.
OTOH, 70 seconds to launch an application ? What does your application do to take such a long time to startup?
|
|
|
|
|
Warm startup is only about 2 seconds...
So ... I don't know ...
I don't do much!
|
|
|
|
|
|
uh.. intel something IIRC. 32 bits, .NET2, 1GB of RAM.
IT tooks a long while to load "simple classes" (well the most complicated does refer to a lot of other types but NOT that many!)
I suspect that one of my problem is an auto-generated ManagedC++ wrapper around some ObjectiveC API. The top level object class has a few hundreds methods! and each class is very big and there are quite a few object!
But the fact is, I just use a few of them...
|
|
|
|
|
You could try measuring the TimeSpans...
Then you can see what actually takes so much time...
I've found a living worth working for, but I haven't found work worth living for.
<marquee>
|
|
|
|
|
I have a DLL written in C++ (VS6) that has some interfaces in it.
I want to implement these interfaces in C#.
how do I create a class in C# that derives from a class in C++ that is in a DLL ?
|
|
|
|
|
How do you mean, interfaces ? C++ does not support interfaces in the C# sense.
You NEED to derive from the class directly, not just reuse the same method names ? Then you need to rewrite the class using C++/CLI ( that is, VC++ 2005 ). VS6 is not going to give you any joy here - you can call VC6 COM objects in C#, but you're going to see an interface only, no classes you could hope to derive from.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
VS2005 Express Edition:
I made a little class with an ManagementEventWatcher object (called myManagementEventWatcher) inside as an private member.
All works fine till I close my application (which uses my little class) and I receive an System.Runtime.InteropServices.InvalidComObjectException. The exception helper says:
COM object that has been separated from its underlying RCW cannot be used.
May be It's cause is that I placed myManagementEventWatcher.Stop() in the destructor of mij little class? But honeslty I don't really know wherelse te place that line of code?
Can someone help me please? Or give me some advice?
Thanks a lot!
|
|
|
|
|
Hello
thunderbirdje wrote: May be It's cause is that I placed myManagementEventWatcher.Stop() in the destructor of mij little class?
In C# there are no destructors. Instead there is a method called Dispose() . Put your Stop() in the If(Disposing) statement of the dispose() method. This should work!
Regards
|
|
|
|
|
If I'm thinking right. I should inherit from the class IDisposible and call the method Dispose() explicit?
Everything works fine now, but I am wondering. Is there maybe an other way instead of calling the Dispose() method explicit from the event Form1_FormClosing ?
I'd love to learn more
Thanks for the answer, Nader Elshehabi!
|
|
|
|
|
Hello
thunderbirdje wrote: I should inherit from the class IDisposible
IDisposable is not a class. It's an interface and you implement it, not inherit from it.
Your form already implements this interface for you, you only have to implement it in classes you write from the scratch. I understood from your post that the ManagementEventWatcher object is in your form. If so just double click on the class file name "*.cs" in your solution explorer to expand it. Then right click on "FormName.Designer.Cs" and view its code. Here you will find you Dispose() method. You don't call it explicitly.
If you still can't find it. View your class using the class explorer, select it, then right click on the Dispose() method name in the members pane, and view the declaration.
Regards
|
|
|
|
|
Hi
Nader Elshehabi wrote: IDisposable is not a class. It's an interface and you implement it, not inherit from it.
Indeed, I am still stuck in C++ terms
I found the Dispose() method. Actually my ManagementEventWatcher is in an object (instance of my little class) who is in term an object of my form.
My little class is a class build from scratch, but like you told me, I implemented the interface IDisposable and everyting works fine now!
Thanks a lot!
|
|
|
|
|
How can I catch a system key in a Form. I tried handling KeyPress, but it only works for regular keys, not for F1, F2 etc.
thanx
|
|
|
|
|
Nevermind, I foud it, I have to handle KeyDown.
|
|
|
|
|
i want to open any file by defalut program
as file test.doc
when i click on the button it will open MS word with this file ...
Palestine
|
|
|
|
|
I'm not sure I quite understand your question, but here it is:
if you need to start a process from your .Net application use System.Diagnostics.Process.Start
(string,string). So for a .doc file you would write:
System.Diagnostics.Process.Start("Word.exe","myFile.doc");
hope this helps
|
|
|
|
|
|
To open with the default program, without having to know what it is, use Process.Start("my.doc")
That will find word and use it. If the filename was an mp3, it would find the default media player, etc.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi,
I am trying to install VS.NET 2003, and i am getting following error:
[08/20/06,09:46:42] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InstallManagerHelper()
[08/20/06,09:46:42] setup.exe: [2] Component error string not specified in ISetupManager::AddToActionResultCollection()
Anyone have idea how to resolve this?
Thanks,
Shafik
|
|
|
|
|
Hello
Maybe the problem is in your copy or something?!! Try installing it on another machine.
Regards
|
|
|
|