|
No problem. Glad to help.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi, I have an unbound DataGridView which I have added two columns to (in the designer): one DataGridViewTextBoxColumn and one DataGridViewCheckBoxColumn. Now I want to add rows to the DataGridView and be able to check and uncheck the cells under the DataGridViewCheckBoxColumn. I use the following code to add a new row but I can't get it to work.
int rowIndex = myDataGridView.Rows.Add();
DataGridViewRow row = myDataGridView.Rows[rowIndex];
row.Cells["columnText"].Value = "some text";
row.Cells["columnCheckBox"].Value = true;
Anyone knows how I can get this to work?
/thanks
|
|
|
|
|
First Of all
thay "Nice" to add rows or handle them :
Object[] Row = { false };<br />
dataGridView1.Rows.Add(Row);<br />
Just Set the Propery of Enable Editing
Adn Thats it
Have Fun
Never forget it
|
|
|
|
|
Sorry but I don't get it..
|
|
|
|
|
When U Add A DataGridViewColumn
See That The Enable Edting Property is Set To True
Then To Add Rows Do THis :
value toCol1Row1 = ....
value toCol2Row1 = ....
value toCol3Row1 = ....
Where value ( int, string...)
Gather all of the Variables to an Object array
Object [] Row1 = {toCol1Row1 ,toCol2Row1 ,toCol3Row1 };
Add it to the DataGrdiView
DataGrdiView.Rows.Add(Row1);
While in your App u need to set the value of the CheckBox Column to
either true/false
bool toCheckBoxColumn = true;
Object [] Row1 = {... ,toCheckBoxColumn ,... };
Have Fun
Never forget it
|
|
|
|
|
Figured it out, thx
|
|
|
|
|
Does anyone know if i can import vrml from .net using c#
Thanks,
Geo
|
|
|
|
|
GeoVx1234 wrote: Does anyone know if i can import vrml from .net using c#
Define "import"
|
|
|
|
|
I've created a 3d terrain using elevation grid in vrml. I'm asking if this .wrl file can be loaded/seen/processed with Visual Studio .NET using c#.
Geo
|
|
|
|
|
Hi
I want to grab frame from a stored video and using GetBitmapBits() method of MediaDet class
<br />
md = new MediaDetClass();<br />
md.Filename = fileName;<br />
md.CurrentStream = 0;<br />
<br />
IntPtr bufPtr = IntPtr.Zero;<br />
int bufSize = 0;<br />
md.GetBitmapBits(0.0, ref bufSize, bufPtr, width, height);
but here I m getting error with third argument."cannot convert from System.IntPtr to 'ref byte'"
Can any1 help out that how to solve this?
Regards
Shanzay
|
|
|
|
|
Check this[^] out.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
Bitmap bmp = new Bitmap(800,600,PixelFormat.Format24bppRgb);
Graphics objGraphics = Graphics.FromImage(bmp);
Rectangle rect = new Rectangle(50,30,600,480);
LinearGradientBrush brush = new LinearGradientBrush(rect,Color.Black,Color.Bisque,LinearGradientMode.BackwardDiagonal);
SolidBrush objSolid = new SolidBrush(Color.Red);
objGraphics.FillRectangle(brush,rect);
objGraphics.DrawString("Hello world",new Font("Curlz MT",78,FontStyle.Bold),objSolid,50,30);
bmp.Save(@"c:\my.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
bmp.Dispose(); I am learning GDI+, I wrote the above code to generate a image with some text specified.
1 - Is there any way to give shadow for the text ?
2 - Is there any way to style the text other than changing font ?
|
|
|
|
|
Here[^] is an example of a drop shadow.
Take care,
Tom
-----------------------------------------------
Check out my blog at http://tjoe.wordpress.com
|
|
|
|
|
|
Hi,
I am facing some isues while implementing a simple logic.
Let me explain you my requirement. Its a simple thing which many people must have done numerous times before me.
I've a hardware connected to my system which needs constant monitoring. It has a specific query command which needs to be sent to it in order to get information from it. The information I get from it needs to be updated on the user screen.
Given this, I am trying to use the Backgroundworker to constantly query the hardware. It works fine. However, the screen doesnt reflect the changes sent by the hardware. It continues to show the same previous state of the hardware on the screen. But, if I add a Thread.sleep value of about 1050 (minimum), then the changes are updated on the screen immediately.
My issue is that the hardware is extremely fast in sending different data to my system which my application must handle and update the GUI at the same pace.
I'll be really obliged if someone could suggest a simple and efficient way to tacke this issue.
Thanks.
Ateeb
|
|
|
|
|
are you taking into consideration the cross threaded affair in this case.
since your textbox control or any control on screen is on main thread and you are updating it from some other thread.which can be done through delegate callback
AMIT
|
|
|
|
|
All that is taken care of.
My main issue remains that of updating the screen with the most recent information from the hardware, which is being thrown in @rate of 10ms.
|
|
|
|
|
I would assume your updates come so fast that the GUI just doesn't have the chance to update itself.
I would suggest you store the updated informationen in some safe place and let the GUI poll for the info (via Windows.Forms.Timer) every 1 second. This way it doesn't get updated so often while ensuring that you don't miss any information from the hardware.
Robert
|
|
|
|
|
Hi,
how are you controlling the repetition rate?
regular .NET timer classes are not good enough to create a 10 msec delay or interval,
you may want to read my timers article.
one possibility is you are getting data more rapidly than the PC can update the display,
if so you should consider:
- a cheaper way of visualizing things (a smaller number of simpler controls); try a
Label or TextBox to just show the last value received, just for checking...
- a reduced frequency, say showing only every other reading.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- use PRE tags to preserve formatting when showing multi-line code snippets
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Hello,
I have a string array {"AAA","BBB","CCC","DDD"}.
I want to be able to print the items in the string[].
I want to be able to send the string[] to a function and the function will print:
AAA BBB CCC DDD
BBB CCC DDD AAA
CCC DDD AAA BBB
DDD AAA BBB CCC
Thanks
Itzik
|
|
|
|
|
Homework?
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
just study the pattern in which these strings are to be written u'll definately get the answer
Amit
|
|
|
|
|
Hello all,
I'm using a webclient class to download a file from some website
so my code is
Webclient webobj=new Webclient();
webobj.DownloadFile("http://www.codeproject.com/into/stuff/cp_bg_black1024.gif",@"c:\MyFiles");
the problem is that it gives me an exception stating i dont have access rights to my folder "c:\MyFiles" i tried enabling access rights to this folder to everyone giving fullcontrol but yet its not working.
Can anyone suggest me a solution to this.does anyone know whats causing the problem.
the detailed error is as follows
System.Net.WebException: An exception occurred during a WebClient request. ---> System.UnauthorizedAccessException: Access to the path 'C:\mydata' is denied.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access)
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
--- End of inner exception stack trace ---
at System.Net.WebClient.DownloadFile(Uri address, String fileName)
at System.Net.WebClient.DownloadFile(String address, String fileName)
at Autdownloadingfile.Form1.btnAutoDwnld_Click(Object sender, EventArgs e) in C:\downloadingfile\Form1.cs:line 33
AMIT
|
|
|
|
|
Hi,
I'm working on a plugin for Outlook, which will allow the user to save their emails into a central repository where it will be accessible from other places, such as a web page. And I'm pondering in what format I should save the emails. Currently I'm using the .msg file format, but there are some problems with displaying it in a web page.
Does anyone have any experience with doing this? I tried saving a mail message as HTML, but apparently that isn't supported unless the mail itself was originally in HTML format.
This is an example of the way I'm doing it currently:
MailMessage msg = ...
String strFilePath = Path.GetTempFileName( );<br />
msg.SaveAs( strFilePath, OlSaveAsType.olMSG );
Simply changing from olMSG to olHTML wasn't working, at least not in all cases.
But as I said, using the MSG file format would be OK if the mail would then display properly from a web page, but there does not seem to be a universal way to open .msg files in a web browser. Or is there? What mime type should I use for .msg files, in order to display properly in web pages?
Regards,
Daníel
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
How can I calculate number of executable lines only of a C# source code?
Essam
|
|
|
|