|
This[^] might be of some assistance.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Thanks for it,
But i would like to convert the dgv column into combobox column when the checkbox is checked for a particular row. (C# Please)
how to convert dgv column to dgv combobox column which shows the drplist items as in the table.
|
|
|
|
|
spankyleo123 wrote: convert the dgv column into combobox column
As a thought, will setting the visibility help you out?
You cannot convert a column into a combobox - you can show and hide different user controls.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
yeah i tried something like this
dgv.Columns[6].Visible = false;<br />
testComboColumn.Visible = true;<br />
testComboColumn.DataSource = tmx.tbTest;<br />
testComboColumn.DisplayMember = "Text";<br />
testComboColumn.ValueMember = "ID";<br />
is it possible to show the combobox list only for the select row?
|
|
|
|
|
AFAIK, you should be creating separate instances of the combobox, one for each row of your datagridview.Me, I'm dishonest. And a dishonest man you can always trust to be dishonest. Honestly. It's the honest ones you want to watch out for...
|
|
|
|
|
|
Hi,
I am developing an application in ASP.NET 2008. In this application i need to print various reports. Some reports need to be printed in customized paper also. For this purpose i am searching for best searching solution of printing reports.
I have more idea in printing in Crystal Report. I know some about JavaScript printing also. Here i have found using Crystal Report is easy for me. But i don't know if i use Crystal Report in my application it affects in performance or not. Which is best printing technique for web application.
Please reply me with some ideas and source codes.
Reply me.
|
|
|
|
|
sharad Pyakurel wrote: I am developing an application in ASP.NET
Well would it not have been better to post your query in the ASP.Net forum?
sharad Pyakurel wrote: Which is best printing technique for web application
Many sites render a page to a PDF document so users can save easily.
sharad Pyakurel wrote: and source codes
You won't get folk on here handing out source code.
|
|
|
|
|
Hi.
I have problem with process exit.
I'm using this code :
Process proc = new Process();
proc.StartInfo.FileName = str;
proc.Start();
proc.WaitForExit();
DoSomeThings();
This code sometimes not working.
For example ,I have opening Visual Studio. I want run process *.cs or *.cpp (Visual studio files) files. That files opened last Visual Studio.After that i don't know my process running or exited.
And i get InvalidOperationException.
How i can know my process running or exited?
Please help me.
Thanks,
Nematjon.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
from MSDN: "Process.Start() returns true if a process resource is started; false if no new process resource is started (for example, if an existing process is reused)."
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Hi Luc.
Thanks for you reply.
I think you don't understand me(soory , my english skils not so good ).
My process started, but i want to know when process exited?
Thanks.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
your code should work fine if the process wasn't already running.
AFAIK it will fail if the process was already running (Start returns false then, and every other Process method will fail).
Solution: if Start returns false, you must get the process from GetProcessesByName() and then WaitForExit() on the correct one.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Thanks for you reply Luc.
Yes , you are right. Start() fuction returned false.
Process proc = new Process();
proc.StartInfo.FileName ="c:\\test.cs";
proc.Start();
proc.WaitForExit();
My file is -test.cs. It default opened with Visual Studio (devenv.exe).
In Visual Studio can be more files (tab page . for example , test.cs, Program.cs, Main.cs ,...).
How i can detect test.cs file closed?
And my file should be anything and they can open anything app.
I think not possible GetProcessesByName().
Thanks.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
it will not always work; e.g. Visual Studio files get launched through devenv.exe, however this isn't the process that you will use in the end, it is just a go-between, and it will close long before your VS closes.
Have a look with Task Manager!
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
I think I see your problem. You're mixing ShellExecute with running a process. When you run a process, the StartInfo.FileName should be the name of the exe file you want to execute. In your particular case, you want to run devenv.exe with C:\test.cs as a commandline parameter. I think if you do that, your code will do what you expect it to do.
BTW, when you specify commandline parameters, make sure you put double-quotes in the string if your commandline contains spaces, like so:
"\"c:\test.cs\"" .45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks.
I try
"\"c:\test.cs\"" .
I just want know when test.cs file closed.
Thanks.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
OHHHHHHHHH. I thought you were trying to determine when the process ended.
You need to set up a thread that tries to open the file access set to FileShare.None . Once it doesn't throw an exception, the file's been closed. Do something like this:
bool closed = false;
do
{
try
{
using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None))
closed = true;
}
catch (Exception ex)
{
if (ex != null) {}
}
} while (!closed)
You could use a BackgroundWorker object since it can post an event when the thread has completed, and you can react to that event..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi John.
Thanks for reply.
My code :
Process proc = new Process();
proc.StartInfo.FileName = fileName;
proc.Start();
bool closed = false;
do
{
try
{
using (FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read, FileShare.None))
closed = true;
}
catch (Exception ex)
{
if (ex != null) {}
}
} while (!closed);
Everytime i get closed=true. So i can't detect when file closed.
My scenario is correct ?
Thanks.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Ya know, I don't have your code, so you're going to have to do the work here.
As a test to see if the do/while loop is working, open the fie in another program (like notepad), and start your do/while loop in a test app (run it under the debugger). I gave that code from memory - you may have to tweak it a little to make it actually do what you want. Did you put the loop into a thread like I suggested?.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks John.
Yeah , like notepad , MS Office and so many files working well.
But some files like cs , cpp files not working ?
Thanks , again for reply.We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Maybe the program that's associated with .CS files is loading the file, and then closing it right away. So, if that's the case, that would make the file itself available, but you wouldn't know if it had been changed.
Maybe you need to use a FileSystemWatcher on the .CS file to monitor it for changes until the program you ran in the process object terminates.
I'm just grasping at straws here because you haven't fully described the problem..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
You could do this:
public void StartProcess()
{
Process proc = new Process....
proc.EnableRaisingEvents = true;
proc.Exited += new EventHandler(process_Exited);
proc.Start();
}
private void process_Exited(object sender, EventArgs e)
{
Process process = sender as Process;
} .45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi.
Thanks for reply.
I was try this , but same results. I not yet know when my file closed ?We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
Well, without seeing all of the related code, we can't help you..45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Thanks for your honest to goodness answer. We are haven't bug,just temporarily undecided problems.
|
|
|
|
|
You are trying to determine when Visual Studio closes the file without Visual Studio exiting? You cannot determine that using the Process class or FileSystemWatcher, or any other external component. The only way to figure that out is to write code that talks to Visual Studio itself and ask what the currently open documents are. No, I don't know how to do that.
|
|
|
|