|
So what exactly is the problem?
Getting the highlighted cell text or passing it to the other form?
If problem is passing then use a delegate or (and I really don't recomend this one)
a simple static method in the form1 that sets the text of thexbox 1.
The delegate is the way I would go.
|
|
|
|
|
This[^] will give you the basic idea
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|
|
I have a project (Windows Application) where I have a DataGridView control, inside of this I have a DataGridViewComboBoxColumn field, and I need when i open that DataGridViewComboBoxColumn to have another DataGridView inside it(something like we have dateTimepicker in datagridviewcomboboxColumn).
So Plz HELP!
|
|
|
|
|
This may be of some help.
|
|
|
|
|
Thanks for your ans !
But not use for me!
|
|
|
|
|
Hi,
Please reply to proper message. You are replying your own message.
While replying please make sure your are replying to proper person/message, which will help you get answer as early as possible.
Cheers !
Abhijit
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Sorry !
I will pay attention to your Advise !
|
|
|
|
|
lol AGAIN
Hey the message u want reply see the Reply link on that message. Every message got that link, you might wanna wonder why ?
|
|
|
|
|
I was mistake !
Thanks for alerting me !
Now plz ans my question and give me a great HELP!
|
|
|
|
|
jojoba2011 wrote: I was mistake !
Now you are ABSOLUTE TRUTH
|
|
|
|
|
Very Shame for CodeProject Users that nobody can solve this problem!
Plz HELP!
|
|
|
|
|
Hy,
It's not that they can't it's just a lot of work.
Look at Luc's answer bellow.
You have to implement/draw a custom datagridview => a lot of work.
modified on Sunday, April 11, 2010 10:34 PM
|
|
|
|
|
Unless the state of the art has evolved since two days ago, this[^] must be the answer to your question.
|
|
|
|
|
Plz give me more options and helps!
|
|
|
|
|
OK Just to help with what exactly you need to do is to develop classes just like CheckboxColumn
1. DataGridViewCheckBoxColumn
2. DataGridViewCheckBoxCell
3. DataGridViewCheckBoxCell.DataGridViewCheckBoxCellAccessibleObject
OR
You might achieve it by inheriting these classes to support your need
And Yes its a lot of work !!! Sorry it doesn't mean no one here on CodeProject want to help you.
BTW I think you already has an answer when you said "something like we have dateTimepicker in datagridviewcomboboxColumn" in you first post. Try to learn from that and implement DatagridView in place of datatimepicker
Makes sense ?
|
|
|
|
|
Hi,
I've written the following code for batch renaming.
Is it Horror ? if so, how should I fix it?
private void rename_Click(object sender, EventArgs e)
{
DialogResult result = MessageBox.Show("Are you sure ?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (result == DialogResult.Yes)
{
Thread tr = new Thread(new ThreadStart(chnTarget));
tr.Start();
}
}
private void chnTarget()
{
this.Invoke(new ThreadStart(ChangeName));
}
bool cancel = false;
private void ChangeName()
{
Random rand = new Random(DateTime.Now.Second);
string folder_path = SelectedPathText.Text;
long progress_value = 0;
string new_filename = "";
cancel = false;
progressBar1.Minimum = 0;
progressBar1.Value = 0;
try
{
string[] FullPathFileNames = System.IO.Directory.GetFiles(folder_path);
progressBar1.Maximum = FullPathFileNames.Length;
if (FullPathFileNames.Length == 0) throw new Exception("No File Found \n");
foreach (string filename in FullPathFileNames)
{
if (cancel)
{
labelResult.Text = "Canceled";
break;
}
progress_value++;
try
{
if (!radioRandom.Checked)
{
new_filename = folder_path + "\\" + textBoxTemplate.Text + progress_value + Path.GetExtension(filename);
}
else
{
if (checkBoxOmitExtension.Checked)
new_filename = folder_path + "\\" + rand.Next();
else
new_filename = folder_path + "\\" + rand.Next() + Path.GetExtension(filename);
}
File.Move(filename, new_filename);
Application.DoEvents();
}
catch { }
progressBar1.Value = (int)progress_value;
progressBar1.Update();
}
labelResult.Text = "Complete";
cancel = false;
}
catch (Exception ex)
{
labelResult.Text = ex.Message;
}
}
The Project of above snippet code:
Batch Renamer in C#[^]
|
|
|
|
|
yes.
Seishin# is correct all the way.
|
|
|
|
|
Well, How should I fix it?
Where is the problem ?
|
|
|
|
|
you really want me to repeat what he said?
1. don't use lots of File.Move() without checking first that no conflicts (file overwrites) will result. Solution: add code to get a two-pass approach, first mimic the renames, and if all seem to be successful, then actually do them.
2+3. don't create a thread that doesn't do a thing. this.Invoke(X) causes X to run on the main thread. And don't abuse Application.DoEvents()
Solution: choose a different threading approach, e.g. use a BackgroundWorker, put the rename operation in its DoWork, and report progress using the ProgressChanged event.
|
|
|
|
|
|
you're welcome.
|
|
|
|
|
well done!
|
|
|
|
|
Hi all,
I need to call "Desktop Property" screen in C# but I do not know how to do this.
(Can I use process.start to do this?)
Pls help me to solve this problem.
Thanks in advance
|
|
|
|
|
This should do it:
Process p = new Process();
p.StartInfo.FileName = @"C:\WINDOWS\system32\rundll32.exe";
p.StartInfo.Arguments = "shell32.dll,Control_RunDLL desk.cpl,,3";
p.Start(); Of course you should compute the WinSys32 path instead of assuming the string shown in the code fragment. For other RUNDLL32 parameters, see this[^] link.
/ravi
|
|
|
|
|
Thanks so much, ravi.
Have a nice day
|
|
|
|