|
I do not quite understand how to add the microsoft.office.interop.excel. Guys the examples I have found when searching through google were those for asp.net or vb.net. I am only interested in the C#.net part of it. Can anybody show me how to make the first step, the rest i can follow.
Please
phokojoe
|
|
|
|
|
Hello!
I have a DataGridView object (not DataGrid) that has three DropDown ComboBoxes (cboOne, cboTwo and cboThree) in columns one,two and three. I need to update contents of cboTwo dynamically depending on the selection in cboOne on the same grid. Then based on selection from cboTwo, cboThree should change it's contents.
Please consider that every row could have a different selection for cboOne that would impact available choices for cboTwo that in turn would impact contents of cboThree.
I am just wondering if someone can help me out - if at all this is possible.
Thank you.
CrazyYankee
|
|
|
|
|
crzyank wrote: if at all this is possible.
DataGridView ComboBox column Source DataBinding is Column based not row based. I beleive you would have to write your own data binding mechanism to accomplish that.
led mike
|
|
|
|
|
You can use CellValueChanged event of dataGridView and write some code in this event.
i make a sample of code
you must know the index of col1 which will effect the values of col2.
this code is getting the object of cell1 and remove it from cell2
private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex == 1)
{
object _value = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value;
((DataGridViewComboBoxCell)dataGridView1.Rows[e.RowIndex].Cells[2]).Items.Remove(_value);
}
}
i hope this will help you
mca
|
|
|
|
|
I want to be able to administer my application remotely. That mean that I want to be able to perform all the actions my application can do but from another machine. This can be done by using remote desktop but my client want me to do it.
the solution I'm thinking of consist of allowing the user to define if he want to access the application remotely or localy in case he want to access it remotely he enters the IP address of the remote host so that all the files and databases pathes are those of the Ip host. for example instead of a locall c:\eventscheduler.xml i'll have 192.168.0.8/c:\eventscheduler.xml
Is this solution correct? If not how can i mimik desktop connection or how can i do it? Any idea will be appriciated?
|
|
|
|
|
How can I set alarm on events in event calendar?
|
|
|
|
|
Hi,
I'm tried to make a controlgrid (just like in Delphi) but have a problem...
I have a class A wich is inherited from System.Windows.Forms.Panel
I create a panel B (color red) in the class A constructor.
Now i can see both panels on my form... and class A is like every other component in designtime,
i can drag it to another place.. and put controls on it.
But the panel B wich is created in A is not editable at all.. and i also want to drag some other components like labels and textboxes on it. So i can create similar B classes (including the labels i dragged on it) on my class A.
any idea how i can make it?
thx
Kurt
|
|
|
|
|
Hello,
Seem that your controls on the base form are private members.
You could change them to protected or public than you would be able to change their properties.
All the best,
Martin
|
|
|
|
|
When you define an event you can do like this.Resize += ... (which is what i always do), but i saw someone use -= too...what's the difference? what does it do? o_O
|
|
|
|
|
Hello,
In short words:
+= connects an eventhandler.
-= disconnects an eventhandler.
All the best,
Martin
|
|
|
|
|
|
Hi,
I want to add that there is some magic involved: when you first did
event += new EventHandler(something);
and later do
event -= new EventHandler(something);
you actually create a new object to remove some older object from a list, but it works !
|
|
|
|
|
Hi,
I'm trying to save a jpeg onto a web server using a web service with a c# desktop app as the Web service consumer. I'm passing the image as a byte array
Here's the client side method:
public static byte[] GetBytes(Bitmap bmp)<br />
{<br />
if (bmp == null)<br />
return new byte[0];<br />
<br />
System.IO.MemoryStream stream = new System.IO.MemoryStream();<br />
bmp.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);<br />
<br />
return stream.GetBuffer();<br />
}
And here's the Server side code to get a bitmap back:
private static Bitmap GetImage(byte[] bytes)<br />
{<br />
if (bytes == null)<br />
return null;<br />
<br />
if (bytes.Length == 0)<br />
return null;<br />
<br />
System.IO.MemoryStream stream = new System.IO.MemoryStream(bytes);<br />
Bitmap b = new Bitmap(stream);<br />
stream.Close();<br />
return (Bitmap)b.Clone();<br />
}
This is the code that actually saves the image:
Bitmap bm = GetImage(imageData);<br />
GetImage(imageData).Save(@"c:\" + FileName,System.Drawing.Imaging.ImageFormat.Jpeg);
And i get this:
A generic error occurred in GDI+.\n at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)\n at System.Drawing.Image.Save(String filename, ImageFormat format)
Any ideas what i'm doing wrong? I assume i'm trying to save in the wrong format or something but i've tried all sorts of things to no avail
Thanks
Russell
|
|
|
|
|
I found this link:
It seems that cleaning up after myself using stream.Close(); was a bad idea
Russell
|
|
|
|
|
|
i want some important differences between asp and asp.net
|
|
|
|
|
|
;P
Programmer: A biological machine designed to convert caffeine into code. Developer: A person who develops working systems by writing and using software.
[ ^]
|
|
|
|
|
Important differences? How can anyone answer that without knowing what's important to you?
Have you tried to search[^]? This topic has been discussed many times all over the world, it hardly needs repeating again just for you.
Do a search and see what you find. When you have read some about it you are more than welcome to ask any more enlighted questions here, and there is a much greater chance that someone can and will give you an answer.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
I'm trying to create a C# application that uses SOAP to communicate with a SOAP enabled server. The only snag is that the server uses TLS-PSK (transport layer security with pre-shared keys).
I can use wsdl.exe to convert the wsdl files to C# classes, but I can’t find any way to implement TLS-PSK security. The generated classes inherit from System.Web.Services.Protocols.SoapHttpClientProtocol, this class does most of the work, and more importantly, the sending of the data.
So how, other than re-creating the SoapHttpClientProtocol class, do I go about implementing the required security on my client application?
|
|
|
|
|
Hello,
I have a mdi (painting) problem. I'll try to be short and to the point:
Situation:
I have a MDI form. Instead of having the standard minmize, restore, etc buttons (when the mdi child is maximized) I have my own tabstrip control where I've created those buttons. I also have my own behavior when one child is minimized, maximized or restored, only the one child is changed (the rest keep their state).
How:
First of all, the handling is done by overriding WndProc in the child. I check WM_SIZE to see if the child is SIZE_MAXIMIZED, if it is I set WindowState to Normal, and dock the child instead (otherwise I'll get the system buttons as normal mdi behavior). I also check when the systembuttons are clicked, and dock instead of maximize, etc.
Problem:
When changing through the childs I have ALOT of flicker, and one of the main problems is that I see the caption bar of the child for a split second. I think that's what causing the flicker (or at least much of it), because the child and it's controls are doing a lot of resizing and moving. If I return when I get the WM_NCACTIVATE message, there's no flicker, but of course I can't return, that's just causing a lot of other problems.
So, does anyone have any suggestions how to get rid of the flicker, or how to NOT paint the caption bar?
Here's the WndProc override:
<br />
protected override void WndProc(ref Message m)<br />
{<br />
if (this.blockWndProc)<br />
return;<br />
<br />
if (m.Msg == WM_SYSCOMMAND || m.Msg == WM_NCLBUTTONDBLCLK)<br />
{<br />
if (this.Parent != null)<br />
{<br />
if ((int)m.WParam == SC_MAXIMIZE || (int)m.WParam == HTCAPTION)<br />
{<br />
this.Dock = DockStyle.Fill;<br />
return;<br />
}<br />
if ((int)m.WParam == SC_RESTORE)<br />
{<br />
this.Dock = DockStyle.None;<br />
this.Size = this.restoreSize;<br />
return;<br />
}<br />
}<br />
}<br />
<br />
if (m.Msg == WM_SIZE)<br />
{<br />
if ((int)m.WParam == SIZE_MAXIMIZED && this.Parent != null)<br />
{<br />
this.restoreSize = this.RestoreBounds.Size;<br />
<br />
this.blockWndProc = true;<br />
this.WindowState = FormWindowState.Normal;<br />
this.blockWndProc = false;<br />
<br />
this.Dock = DockStyle.Fill;<br />
}<br />
}<br />
<br />
<br />
base.WndProc(ref m);<br />
}<br />
|
|
|
|
|
Hello,
Have you also tried to work with "this.SuspendLayout();" ... "this.ResumeLayout(true);", like the designer does?
All the best,
Martin
|
|
|
|
|
Yes, I have and it doesn't solve the problem.
|
|
|
|
|
Have you tried using the Control.SetStyle method? There's a number of properties that might be useful for you in it, including double buffering and such...
Standards are great! Everybody should have one!
|
|
|
|
|
I am using double buffering, but I don't think I've looked at the SetStyle method.
Anyway, I've been digging in the framework with .NET reflector, and I've managed to disable the mdi system buttons. So, I'm trying to use the standard functionality right now, meaning I won't dock the childs. To get the functionality I want, I override WndProc, and return when I get the message to maximize the window... So now restore and maximize will restore / maximize only the selected child.
|
|
|
|