|
foreach (DataRow drProfile in dtProfiles.Rows)
{
DataGridViewRow dgvr = new DataGridViewRow();
DataGridViewTextBoxCell dgvic = new DataGridViewTextBoxCell();
//dgvic.ImageLayout = DataGridViewImageCellLayout.Normal;
//dgvic.ValueIsIcon = true;
dgvic.Value = drProfile["profile_id"].ToString();
dgvr.Cells.Add(dgvic);
DataGridViewTextBoxCell dgvtName = new DataGridViewTextBoxCell();
dgvtName.Value = drProfile["profile_name"].ToString();
dgvr.Cells.Add(dgvtName);
DataGridViewTextBoxCell dgvtClient = new DataGridViewTextBoxCell();
dgvtClient.Value = drProfile["client_name"].ToString();
dgvr.Cells.Add(dgvtClient);
DataGridViewTextBoxCell dgvtDate = new DataGridViewTextBoxCell();
dgvtDate.Value = drProfile["date_modified"].ToString();
dgvr.Cells.Add(dgvtDate);
dgvProfileList.Rows.Add(dgvr); //I get the error here. No row can be added to a DataGridView control that does not have columns. Columns must be added first.
}
}
|
|
|
|
|
What do you think it means ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Can anybody give me the checklist to make sure when class is decorated with [Seializable] attribute. For eg. if this class referred anywhere , where the other class is serialized or not serialized, or used as collection variable.
Thanks
|
|
|
|
|
Do all the integral numeric types implement some interface, like IInteger? I want to make a single method as follows:
public T someMethod<t>(T i1, T i2) where T : IInteger {
...
}
</t> Is such a thing possible without redeclaring the same method over and over again? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
public T someMethod(T i1, T i2) where T:struct
will give you a method that only works with value types. That's as good as it gets, I think.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hey all,
Today I would like to start a little program for me, just for fun.
I use flasget as the default download manager because of the speed and wide range of downloads options.
However due to the lack of my own "Internet connection", i have a little problem. My problem is that i share the internet connection and whenever i use flashget the bandwith goes down to everyone and i kind of dislike the internet to be unplugged when i am downloading something, so i thought that maybe checking the network bandwith, could anyone lead me on this as well, i could decide whether to start flashget or not, normally night time it is always a good idea to do so but not always... to avoid any complaints from my lovely neighbors... the reason of sharing the internet connection is because it is cheaper!
Would it be possible to control Flashget behavior from another program, like decide which torrent to download? any suggestions?
So far i can start flashget from my little notepad program and run it for a certain amount of time, but for this to work flashget needs to be configured to automatically start downloading when it starts, and i would like to automate that .
Thanks in advance.
Luis E Tineo S
|
|
|
|
|
Hello,
I'm a newbie to using DirectX. My goal is to render a digital image on what looks like a coffee mug and rotate it. I downloaded the DirectX SDK and started playing with the code in the tutorials. (For reasons I won't go into here, I needed to download the older Summer 2004 DX-SDK which shipped with the DirectX 9.0c runtime and managed classes.)
I was able to modify tutorial 5, "Using texture maps", and come close to what I want (minus the handle on the mug). Unfortunately, when the image was texture mapped on the cylinder, two unexpected things happened. One was the image as viewed from the exterior of the cylinder was reversed. I overcame this by mirroring the image I was using for texture, though I wonder if I somehow could have avoided doing that by changing the code.
The other surprise is that the image appears on both the interior and exterior of the cylinder. Keeping my ultimate goal in mind, obviously I would like the interior to remain a solid color, such a white, and show the image only on the exterior. Could anyone offer some help on how to accomplish this? I'd appreciate it.
BTW: I'm still on the v1.1 Framework
Regards,
Rich
|
|
|
|
|
I imagine you'd need to create a second model, of the inside of the cup, and texture it the way you want it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am fairly new to C#, how do I get a dialog box to fully display before executing any code. There is no user interaction, but I display messages during the execution, but they never are seen since the box does not finish displaying until the code is finished.
|
|
|
|
|
Hi,
the code you put in the form's constructor, or in its Load handler, will execute before the
form is visible.
And any code you put in any of its event handlers will run on the main or "GUI thread" at the
expense of a good user interaction.
If you have a lenghty operation, you really should use one (or more) separate threads, either
simply instances of Thread, or members of ThreadPool, or a BackgroundWorker. That way the
long operation is handled independent of the user interaction, so the form would continue to
respond to moves, resizes, repaints, etc.
If the long operation needs to start all by itself, launch the thread(s) from inside
the form's Load handler. If it should be launched by say a button click, you obviously
would put the thread launch code in the Button's Click handler.
Warning: as soon as you start using separate threads you will need Control.InvokeRequired
and Control.Invoke() to allow such threads to access the Form or its Controls, because only
one thread is allowed to directly access Controls (the thread that created them).
There are plenty of examples of this, at CodeProject and everywhere else.
|
|
|
|
|
This always happens - I start a reply, get distracted, finish it, and look like I replied when I had nothing to add...
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
"second that" is fine too
|
|
|
|
|
Hard to know for sure, but I'd guess that the problem is that you've got a form showing modelessly ( show instead of showdialog ) and it doesn't show while the thread is busy with other processing you do directly after. Call ShowDialog and your code will stop until the form is closed. Use a seperate thread to do processing and keep your UI working, or call Application.DoEvents to force a paint event.
Hard to say if this is the problem, without seeing the code.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Do all your work in the OnShown method of your main form (which happens after the form is, well, shown). The next step would be to take Luc's advice and port your initialization code to a separate thread which could be called from the construtor or the OnLoad event.
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
OnShown is the perfect answer. Now the user can see all the messages as the program runs. Thank you so much.
|
|
|
|
|
Why is it that this class is listed as part of .Net 2.0, but I cannot locate it? I am using the .Net framework version 2.0.50727. Does anyone know why this class is unavailable to me? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
modified on Wednesday, December 12, 2007 12:47:42 PM
|
|
|
|
|
|
Wow, that is weird... I was already using things like RijndaelManaged class from the System.Security.Cryptography namespace without adding the reference to System.Security. However, to use the ProtectedData class I needed to have that reference. Why the inconsistency?
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
You set a reference to a project, .DLL, or some other library.
You import namespaces, not set a reference to them.
Yes, you already set a reference to the System.Security.DLL. Then you imported the System.Security.Cryptography names contained in the DLL. Importing System.Security.Cryptography does NOT automatically import its parent namespaces, System and System.Security. There is no inconsistancy.
|
|
|
|
|
Actually, the flow went like this...
using System.Security.Cryptography;
namespace foo {
public class myClass {
private RSACryptoServiceProvider m_AsymAlg =
new RSACryptoServiceProvider(ASYM_KEY_SIZE);
private RijndaelManaged m_SymAlg = new RijndaelManaged();
}
}
Then, I tried to access the ProtectedData class from the SAME NAMESPACE I had previously imported, but that reference was NOT there. Why was I able to access both the RijndaelManaged and RSACryptoServiceProvider classes without the reference to System.Security(.dll), but not the ProtectedData class? This seems like it is inconsistent, unless the two are in different DLL's with the same namespace declared. Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Skippums wrote: unless the two are in different DLL's with the same namespace declared
Bingo! Yes, multiple DLL's can contribute classes to the same namespace.
If you look at the documentation in MSDN for the Rijndael and RSACryptoServiceProvider classes and you see, at the top of the "about" page for every class, which namespace and .DLL the class resides in. These two classes sit in the .NET Core Library, which is "mscorlib.dll".
There are examples of this "multiple contributors" scheme all over the .NET Framework.
|
|
|
|
|
Please try as Dave said.
SSK.
Anyone who says sunshine brings happiness has never danced in the rain.
|
|
|
|
|
Hi all!
I can't make an image is printed in the middle of a page.
I use this code:
printDocument = new PrintDocument();
printDocument.OriginAtMargins = true;
printDocument.DefaultPageSettings.Margins = new margins((int)printDocument.DefaultPageSettings.HardMarginX,
(int)printDocument.DefaultPageSettings.HardMarginX, (int)printDocument.DefaultPageSettings.HardMarginY,
(int)printDocument.DefaultPageSettings.HardMarginY);
x = xCenter;
y = yCenter;
x -= MeasureConverter.FromUnitToUnit(UnitOfMeasurement.Inches, UnitOfMeasurement.Millimeters,
printDocument.DefaultPageSettings.HardMarginX / 100);
y -= MeasureConverter.FromUnitToUnit(UnitOfMeasurement.Inches, UnitOfMeasurement.Millimeters,
printDocument.DefaultPageSettings.HardMarginY / 100);
...
X and Y are given in millimeters, and in my printDocument_PrintPage method I have:
Graphics g = e.Graphics;
g.PageUnit = GraphicsUnit.Millimeter;
g.DrawImage(printableObj.GetMetafileImage(), x, y);
g.Dispose();
e.HasMorePages = false;
Unfortunately my image is printed not exactly in the center...
Can you help me, pls?
Thnks in advantage.
|
|
|
|
|
Do you have this working yet?
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
I still have this problem...
|
|
|
|