|
Hi skywen,
When you are using Datagrid control on winforms by default it allows you to add, delete , update rows during the runtime. If you are using a Data grid webserver control you need to use footer template to create this functionality.
Thanks
SGS
|
|
|
|
|
One suggestion i found was to extend System.ComponentModel.Component
My problem is that thing doesnt have paint or other necessary visual functions. Any other ways?
...My situation is a control that is like a tooltip not dedication to the form but considers the desktop as it's parent... what it boils down to is i want to make it a component tray restricted control, but give it a custom UI editor so someone can view changes to the control.
|
|
|
|
|
Hi all,
I'm hoping someone can point me in the right direction.
I would like to write a server application that takes data from various elements within a network. These are UNIX based systems which basically will be spitting alarming information at m at a billion miles an hour. Consequently, I'm establish communications with the sending devices. I only want to receive the information they are throwing at me. I don't need to be concerned with the format of the data.
Has anyone suggestions on how best to implement a server type application to recieve the data from 10+ uniques device elements without having to establish a link first. All devices output on the same port number as well to throw in another problem.
Any advice, suggestions would be most appreciated.
Thanks,
Aaron
|
|
|
|
|
I think if you know that simultaneous clients to your server would not exceed 10 you can implement this with a TCP or UDP listener. On each new connection request, spawn a new thread for receiving data. After completion close the socket and thread.
If your number of simultaneous clients are going to exceed that 10, you can think about asynchronous connections.
See socket/tcplistener/udplistener classes and examples in MSDN.
|
|
|
|
|
Sorry - I might have been a bit vague - the data is coming from UNIX clients....
The data is transmitted over a network to an IP I can specify. It will just spit data over a UDP connection to where ever I tell it, but it is not controlled.
I guess what I need is a UDP listener.... hmm
|
|
|
|
|
Check out some of the socket example here in the networking section for C#. You will basically need to set up an asynchronous socket listener on the port # you want the UNIX clients to send messages to. It's a good thing they all send on the same port as that means you will only need to listen on one.
In addition you'll need to format your application level messages to make sure you get a whole message before doing something with it. I suspect your UNIX clients will terminate each individual transmission with some sort of control character. So on your end you'll need to receive until you read in that control char.
Hope this helps!
|
|
|
|
|
How do you create a multicolumn listbox with comboBox's within the columns? I am looking for a control that is similar to one such as the design editor in Microsoft Access or Enterprise Manager. Is there a built in control already created for this?
While using "Spy++" these controls have been called "OGrid" and "DimensionDataCtrl". I am been unable to find a library/assembly with either of these controls.
Thanks.
|
|
|
|
|
hi,
I can suggest you an article which deal these sort of customization.
http://www.codeproject.com/cs/miscctrl/ListViewCellEditors.asp
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
There is probably a very simple reason for this.
I wrote a simple application for a simple assignment. I am having a problem understanding how doubles are subtracted. Here is a code sample:
<br />
double paid = 50.00, owed = 39.67, remainder = 0.0; <br />
remainder = paid - owed;<br />
<br />
Console.Write(remainder);<br />
Console.ReadLine();<br />
This results in a value of 10.33 being printed to the screen. However, if you step into the program you will see that remainder is actually equal to 10.329999999999998.
Can anyone explain to me how C# comes up with this value?
Thanks in advance for your help!
|
|
|
|
|
The binary representation of a fraction is an approximation. Using float or double you'll never get a straight answer, but an approximation.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello,
I've been trying like crazy to figure out how to copy an object of a custom type to the Clipboard via Clipboard.SetDataObject() and then retrieve it with Clipboard.GetDataObject().
I've tried everything I can think of. I declare a DataObject, made out of my custom object, and give it a format name, and send it to the clipboard. Then I bring it back from the clipboard, as an IDataObject, use GetDataPresent(*format name", true), and it says that the data is present. But when I use GetData, it returns null! What is going on here?
There are many demos about how to use the clipboard with strings and bitmaps but that's pretty useless. What's the point of C#'s clipboard support if all you can do is transfer bitmaps?
|
|
|
|
|
|
C# doesn't have clipboard support - .NET exposes the Windows clipboard service to managed languages such as C#.
If you're trying to transfer an object from one AppDomain to another, it won't work. You need to serialize the object and deserialize it on the other end, sort of using the clipboard like a low-tech remoting channel.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Thanks for the quick answer. Someone else wrote the code to use the clipboard and it turns out that this is not necessary--the data is not intended to be copied into another application anyway.
|
|
|
|
|
I have a list of files names in an ArrayList that I want to find and show in one window, like the find feature does in explorer. I am thinking of using the find method and open the folders containing the files. However, I want to be able to show the files in different folders together in a window.
Any suggestions appreaciated, please include code
Thanks,
ff
|
|
|
|
|
Hi,
I'm looking to find the most effective and fastest way to get the duration of a MP3 file.
Code examples or links to lib's would be helpful thanks in advance,
Richard
|
|
|
|
|
Take a look at Reading MP3 Headers[^].
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
This is really frustrating for me.
I'm using both the DTS Com Component in C#, to programatically create a DTS package, save it, then execute it.
Here's the COM exception that got thrown.
Error Code : -2147024882
Source : Microsoft Data Transformation Services (DTS) Package Description :
Not enough storage is available to complete this operation.
HelpFile : sqldts80.hlp
HelpContext : 1100
InterfaceError {10020306-EB1C-11CF-AE6E-00AA004A34D5}.
This definately, can't be a storage or memory issue, as i have 80gig of HD space and 4Gig of Ram. Please advice.
What this DTS Services does is, grab the access files, and insert it into the SQL Server. If there are 10 files, 10 process will be spawn.
Stanley
|
|
|
|
|
I also had this problem in the past. I tried almost everything that was possible, but did not succeed.
The solution, in my case, was creating an unmanaged COM component in VC (you can try using VB6, too, I bet it'll work) and calling DTS from there. Then, I called this new COM component from C#.
Yes, even I am blogging now!
|
|
|
|
|
See, it's the DTS.dll and DTSPump.dll I'm incorporating.
Anyone ?
Stanley
|
|
|
|
|
This really got me thinking.
Now, instead of spawning the process running concurrently of each other, what if i put those process on a Queue. In other words, the process will run one after another.
Would this be any better ?
Stanley
|
|
|
|
|
Hi Gurus,
I managed to solve this mystery puzzles.
I just want to share with the c# community as to how this problem is fixed.
Now first of all, the problems described aboved has nothing to do with not having enough memory or hd space. The reason why this is happening is due to DTSLookups. Now, my production server is running on w2k Advance Server, and my testing server is on windows 2003 (since we're moving in this path).
On the w2k environment, the dts code works. But, it doesn't work with the w2003 environment. To workaround this issue, I have basically, removed all the DTSLookups and introduce another extra steps (stor procedure) to do what the lookups was doing. Up to this point, no more com exception errors, once the workaround has been implemented.
Note:- The error description thrown here is meaningless.
Stanley
|
|
|
|
|
Hello again, Gurus
1. How can you find out which row and column when the mouse hovers or moves over a DataGrid control? NOT MOUSE CLICKING!!! My app is windows-based C#. I am trying to display the contents of the current cell under the mouse pointer in either the grid's tooltip or context-menu.
I already tried out the DataGrid.HitTestInfo & DataGridHitTest, suggested by another Gury. But It seemed only work with Mouse clicking (MouseDown event) only.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwindowsformsdatagridhittestinfoclasstopic.asp
2. I am not sure where to display the cell contents in the grid's tooltip, context-menu, or something else?
Appeciate your input & thanks with another million,
Khang
|
|
|
|
|
DataGrid.HitTest does work, but when not clicking you need to convert the mouse coordinates from screen coordinates to client coordinates. When you click the mouse, the control's event already translates the coordinates for you.
It's quite simple:
Point p = MousePosition;
p = dataGrid1.PointToClient(p);
HitTestInfo info = dataGrid1.HitTest(p); When you respond to mouse clicks, do not translate the coordinates, remember, since they are already translated to client coordinates (client being the control) for you.
This posting is provided "AS IS" with no warranties, and confers no rights.
Software Design Engineer
Developer Division Sustained Engineering
Microsoft
[My Articles]
|
|
|
|
|
Hello again, Heath
I tried both ways:
// Point p = MousePosition;
or
Point p = new Point(e.X, e.Y);
I always got the same row# and col#, no matters where I moved the mouse over the grid data rows:
Row$0:Col$1
Row$0:Col$1
Row$0:Col$1
Row$0:Col$1
Row$0:Col$1
.....
private void dgSelectedParts_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
System.Windows.Forms.DataGrid.HitTestInfo hti;
// Point p = MousePosition;
Point p = new Point(e.X, e.Y);
p = dgSelectedParts.PointToClient(p);
hti = dgSelectedParts.HitTest(p); // DataGrid
Console.WriteLine(String.Format("Row$0:Col$1", hti.Row, hti.Column));
}
Thanks,
Khang
|
|
|
|