|
The problem with that is once you sort the data your "row numbers" are off. Note that you must use the DataView 's view of the row, not the DataTable . Through the CurrencyManager this is typically pretty easy, but I still don't know of a decent way off the top of my head to display and manage that data in a DataGrid . Thank goodness for the DataGridView[^] in .NET 2.0.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
DataGrid is such an awkward control, a major pain if you ask me. I'm looking forward to using .NET 2.0. Any tips to get me in the right direction. Or should I opt for a 3rd party control?
Thanks,
Sam
|
|
|
|
|
If you're not tied to .NET 1.x, I suggest you download Visual Studio 2005 Beta 2[^] and start working with .NET 2.0. You can also get a Go-Live License[^], which is an addendum to the EULA that allows you to distribute applications based on beta 2 into the production environment.
If you need a solution now, I would first suggest some serious research (googling, newsgroups at http://msdn.microsoft.com/newsgroups[^], etc) and then consider a third-party solution. If and when you do move to .NET 2.0 your third-party control would be obsolete, though - honestly - most third-party controls are pretty inexpensive and typically royalty-free.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Hi Everyone,
I have created a service with the help of dotnet framework and without the help of MSI(Installshield). I want to see my service(WindowsService_1) in Windows Service and using "installutil tools" (which Microsoft provided) which install my service in windows service but exception is raised
"Exception occurred while initializing the installation:
System.IO.FileNotFoundException: File or assembly name windowsservice_1.exe, or one of its dependencies, was not found.."
So I am following each and everystep which is given on MSDN example and other site. I want to write a service without using MSI(Installshield).
I go to command prompt(cmd) and write "InstallUtil windowsservice_1.exe". But is throwing an exception.
I am giving full path of InstallUtil.exe.
Can you help me out making a simple service.
Thanks
|
|
|
|
|
For future reference, you should include the full exception stack.
Beyond that it reads like you are missing a dependancy. Fusion is trying to resolve runtime depedancies and fails to find one so it never runs let alone run as a Windows Service. Fix that first.
|
|
|
|
|
In MSI you should use the File key (and the Visual Studio .NET Windows Installer project will continually change this on you) as the argument with quotes, like installutil "[$fileKey]" . You must also either get the full path to installutil.exe by using [WindowsFolder]Microsoft.NET\Framework\v1.1.4322\installutil.exe for .NET 1.1, for example. This can get tricky.
The exception is most likely because one of the assemblies your windowsservice_1.exe assembly depends on is not found. Please read How the Runtime Locates Assemblies[^] for more information. You can also see what assembly is missing by running fuslogvw.exe from the .NET Framework directory.
Finally, you MUST make sure the client has the .NET Framework - to correct version, or you'll need to use a publisher policy - installed or none of this will work. If you write managed code, the runtime is required to run it.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks a lot everyone.
I got my answer and now I can successfully see service in windows service.
Once again
Thanks
|
|
|
|
|
hi
i want to open a new window and send a url address to it for browsing.
wat can i do?
** some thing like href tag with target=_blank **
thanks
|
|
|
|
|
If you mean from a web page, you can't do that. Please ask in the Web Development[^] forum.
If you are automating Internet Explorer (perhaps using the AxWebBrowser control or the InternetExplorer class), you can call Navigate2 with the correct parameters like so:
object url = "http://mydomain.com";
object name = "_blank";
object missing = Missing.Value;
axWebBrowser1.Navigate2(ref url, ref missing, ref name, ref missing, ref missing); If neither of these answer your question, please be specific in your request. Your question is, I must say, rather vague. Please provide as much information as you can that's relevant to your problems and questions.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I have to agree that your question is rather vague.
In case you are talking about automating IE from a windows form you could also take a look at the System.Diagnostics namespace. A couple of straight-forward examples:
Example 1:
Process.Start("IExplore.exe", "www.codeProject.com");
Example 2:
ProcessStartInfo <code>startInfo </code>= new ProcessStartInfo("IExplore.exe");
startInfo.WindowStyle = ProcessWindowStyle.Minimized;
Process.Start(startInfo);
startInfo.Arguments = "www.codeProject.com";
Process.Start(startInfo);
Regards,
Polis
Can you practice what you teach?
|
|
|
|
|
Hi,
I am trying to get the windowstate of a window based on its process id.
Below is what I tried... But the GetWindowPlacement method returns false most of the times inspite of the length of the windowplacvement object being initialized. Even if the method returns true, its showCmd is always NORMAL. While testing my window was always MAXIMIZED!
Can anyone point what I am missing...?
Can anyone explain how the window state is maintained. ......
Thanks!
FormWindowState GetWindowState(int processID)
{
FormWindowState formWindowState = FormWindowState.Normal;
WINDOWPLACEMENT windowPlacement = new WINDOWPLACEMENT();
//If there is not proces by this ID, then return Minimized.
uint processHandle = (uint)Process.GetProcessById(processID).Handle;
if ( processHandle.Equals(0) )
{
return FormWindowState.Minimized;
}
windowPlacement.length = Marshal.SizeOf(windowPlacement);
bool test = Win32Wrapper.GetWindowPlacement(processHandle,ref windowPlacement);
if ( windowPlacement.showCmd == SHOW_STATE.SW_SHOWMINIMIZED )
{
formWindowState = FormWindowState.Minimized;
}
else if ( windowPlacement.showCmd == SHOW_STATE.SW_SHOWMAXIMIZED )
{
formWindowState = FormWindowState.Maximized;
}
}
|
|
|
|
|
Sheela Krishnan wrote:
I am trying to get the windowstate of a window based on its process id.
Below is what I tried... But the GetWindowPlacement method returns false most of the times inspite of the length of the windowplacvement object being initialized. Even if the method returns true, its showCmd is always NORMAL. While testing my window was always MAXIMIZED!
Assuming that Win32Wrapper.GetWindowPlacement() indeed does only encapsulate the native Win32 call, you're simply passing the wrong value. GetWindowPlacement()[^] expects a handle to a window, not to a process. If you're interested in the state of the main window of a process you can use the Process.MainWindowHandle Property[^] to obtain the correct handle.
Best regards
Dennis
|
|
|
|
|
Why when I deriving my own TabControl I am loosing ability to drop other controls from the toolbox on my derived tab control in design mode. Same thing if derive may PropertyPage. In MFC I was able create several dialogs in design mode than dynamicaly connect them to the PropertySheet. How to do somthing similar in C#.
Thanks
Alex.
|
|
|
|
|
Alex_Y wrote:
Why when I deriving my own TabControl I am loosing ability to drop other controls from the toolbox on my derived tab control in design mode.
Hmmm. I thought the only thing you can do with a TabControl is add TabPages. Then you can drop controls onto the TabPage.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
What if want to derive my own Pages? My question is true if deriving TabControl and/or Pages after that I can only manualy create/locate controls on the pages. Because may be I missing something. Why design mode can't handle derived classes. I could understand when control is simple like editbox on which I don't need to drop anything, but in TabControl main purpose is to hold other controls.
Thanks,
Alex.
|
|
|
|
|
Alex_Y wrote:
What if want to derive my own Pages?
Ah, ok. Then, you'd have to implement in your derived class the class and property attributes that are required to support the designer. However, I suspect you'll still run into problems because I don't know how you can tell the designer to add your tab pages and not the TabPage class. I guess that's a question for someone who knows the designer really well.
Still, it seems that if you make your MyTabPage class designer compliant and add it to the toolbox, you should be able to drop them onto the TabControl.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Also I noticed anything you drop on MyTab it became not a member of MyTab it always became a member of form which hold's MyTab.
Other issue if I create MyTab and manualy add MyPage after that in form design you can't drop on that page it is locked, but if you add another page which is not MyPage type it is no problem to drop on that default type page.
While I play with all that experiments designer was always trying to analyze content of MyTab and recreate all content one more time in the Form class. So as result I got instead of two pages which I had in MyTab but four two from Form + two from MyTab.
Thanks.
Alex
|
|
|
|
|
Hi... i am a student and i am currently working on an Address book in C#. The address book is supposed to create a fancy business card and then save it to a JPG file. The business card is created in the program within a panel with a background picture and transparent textboxes. I would like to make an option for the user to let them save the business card to a JPG file. is that possible? As mylecturers couldn`t help me about this.
Thanks
|
|
|
|
|
You mean you want to take a screenshot and not have to generate the picture yourself? Either are possible. To take a screenshot of a particular client region of a control (or even the whole control), you need to P/Invoke bitblt from gdi.dll and related functions. Read Image Capture[^] for more information, or search[^] for "bitblt" or "screenshot" here on Code Project in the appropriate categories (like "C#" and ".NET").
In .NET 2.0, a new method[^] - Control.DrawToBitmap - has been added which will make this easier (by encapsulating the functionality from above).
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
I would like a place holder class btween my Screen Form and Windows Form. So, I create MyBaseForm class that inherits from System.Windows.Forms.Form. Then I create MYScreenForm class that inherits from MyBaseForm. However, at design time, I am not able to see the MyScreenForm. It gives the following error:
Request for the permission to type System.Security.Permissions.FileIOPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeytoken=.... failed.
Thus, I am not able todesign my screen visually.
Note that I can place any controls programmatically and the code compiles and runs.
Appreciate any explanations / help
|
|
|
|
|
From where is your code running? A FileIOPermission is a code access security permission class that is granted, by default, to all code run from your machine. If your code is running from the intranet or Internet, it is granted even fewer permissions.
For a good overview of Code Access Security in .NET, read Understanding .NET Code Access Security[^] here on Code Project.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
The application is not even running!
This error occurs at design time in the Visual Studio. Both classes -- MyBaseForm and MyScreenForm -- are in the same project. In the Solution explorer I click on the MyScreenForm (which inherits from MyBaseForm) to view it in design mode in order to add some controls. Instead of showing the form, this error appears.
Thanks
|
|
|
|
|
But the code is running, actually. Notice that when you try to create an inheritted form VS.NET will complain if the assembly that contains the would-be parent form is not compiled yet?
If your target location for the assembly is on a network share, for example - even if the drive is mapped - you will most like get a SecurityException because the FileIOPermission isn't granted, by default, to anything but FullTrust code which is only given, by default, to the "My Computer" zone.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|
|
Thanks Heath,
When I wrote "It is not even running" I meant I did not even execute. Yes, it is running.
The problem I am referring to occurs at design time - not at run time. Since I am not executing the code, I thought the IO error should not have occured. However, VS IDE probably is trying to execute the MyBaseForm code so as to display the form in design mode. So, this morning I changed the security to FullTrust - for the module that contains MyBaseForm. However, when tried to view MyScreenForm in design mode, it still did not work.
Request help.
Thanks once again.
Snnn
|
|
|
|
|
Again, the code is actually executing in design mode and serializes to a source file. Depending on what yo'ure trying to do an when, Code Access Security can prevent an application from running (it verifies that an application has the necessary minimal permission set) or from performing a certain action while running (if you demand a certain permission).
Please read that CAS article I posted in my previous reply.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Customer Product-lifecycle Experience
Microsoft
[My Articles] [My Blog]
|
|
|
|