|
I'm creating a little system to interface to quickbooks inventory. I want the user to hit a button that will populate the system with the inventory items from qb. Then click a checkbox in the grid that will indicate which items that are necessary for the process.
Using the smarttags I've added a checkbox column to the grid. Then in code, after I've retrieved the xml file from qb, I add 2 more columns for the item key and description.
I noticed a little issue. If I click on any of the grid columns to reorder the grid, any checks are cleared.
Any suggestions on what I need to set for the checkboxes to maintain their values?
Thanks,
PF
|
|
|
|
|
perryf00 wrote: If I click on any of the grid columns to reorder the grid, any checks are cleared.
I checked this but didn't find such problem. Try to check your code thoroughly, specially the grid events that you used in your code and values assignment to the grid.
Best Regards.
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
I have columns that I sort with column header. After clicking on column, the sort triangle icon for ascending and descending, wraps around and jumps way to the left of the column while adding a row beneath the column headers. I need the icon to stay directly to the left of the column header and not insert another row. Any ideas?
Greg
|
|
|
|
|
Perhaps you should start by mention what it is that you are doing.
Is it a windows application or a web application? Are you using some kind of component to display the columns?
---
b { font-weight: normal; }
|
|
|
|
|
|
i need help in c# that i have a code of msn messenger in c# but the problem is it need the proxy setting and and port no what i assign it and if i sign up without proxy and port no then an error of illegal mail address or password how i solve this problem any body have solution of this then help me for this thanks
|
|
|
|
|
Please use punctuation when you write. Then someone might understand what you are trying to say.
---
b { font-weight: normal; }
|
|
|
|
|
hi everybody!
how can i check if the computer is connected to the internet or not?
i don't wanna try to connect every 2 seconds or use a service for monitoring the pc...
i have to check the status changes as well.
any ideas?all welcome...
thanks in advace
Enrico
VentoEngine corp.
Program your life ^^
|
|
|
|
|
|
the problem is: i have to do something when the computer start an internet connection.
I can't simply control the status...i want to intercept the event "On Connected"..
I hope you understand
VentoEngine corp.
Program your life ^^
|
|
|
|
|
I have a class I am calling SimTreeNode which is a System.Windows.Forms.TreeNode type. I am planning on using this class within my TreeView class.
Class Definition:
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
<br />
namespace SimTree<br />
{<br />
public class SimTreeNode : System.Windows.Forms.TreeNode<br />
{<br />
<br />
}<br />
}
As you can see, I don't do anything more or less than the TreeNode class.
The problem is, when I try to use my SimTreeNode in place of any TreeNode in my TreeView class, it throws runtime errors.
Here is the snippet of code I am doing the conversion.
using System.Collections;<br />
using System.Collections.Generic;<br />
using System.ComponentModel;<br />
using System.Drawing;<br />
using System.Data;<br />
using System.Text;<br />
using System.Windows.Forms;<br />
using System.Xml;<br />
using System.Xml.Serialization;<br />
using SimTree.Properties;<br />
using System.Runtime.InteropServices;<br />
<br />
namespace SimTree<br />
{<br />
public partial class SimTree : System.Windows.Forms.TreeView<br />
{<br />
<br />
private void SimTree_ItemDrag(object sender, ItemDragEventArgs e)<br />
{<br />
Point pt = this.PointToClient(Control.MousePosition);<br />
SimTreeNode tn = (SimTreeNode)this.GetNodeAt(pt);
<br />
...<br />
}<br />
}<br />
}
Runtime Error:
Unable to cast object of type 'System.Windows.Forms.TreeNode' to type 'SimTree.SimTreeNode'.
I would like to know why I cant caste my derived type to my base type.
According to a million online forums, I don't need to make an explicit operator to caste to/from base types. I actually tried to make an explicit caste operator if you look at my comments in the SimTree.SimTreeNode class, but gave me a compiler error:
Error 1 'SimTree.SimTreeNode.explicit operator SimTree.SimTreeNode(System.Windows.Forms.TreeNode)': user-defined conversion to/from base class C:\...\SimTree\SimTreeNode.cs 10 23 SimTree
This really doesn't make any sense to me as the compiler SHOULDN'T have anyway of telling how to convert a base type to a derived type without me telling it explicitly.
I am hitting brick walls left and right with this simple thing I want to do.
|
|
|
|
|
Are you sure that all the nodes in your tree actually are SimTreeNodes? How are you adding nodes to the tree?
Melon00 wrote: I would like to know why I cant caste my derived type to my base type.
Aren't you attempting to cast from the base class (TreeNode) to the derived type (SimTreeNode)?
|
|
|
|
|
Post the code where you add nodes to the tree. Let's start there.
Josh
|
|
|
|
|
The object that you are trying to cast simply isn't a SimTreeNode. One reason could be that the GetNodeAt method didn't find any node at the point, and is returning a null value.
You have to check if the node is null before you try to cast it.
If the TreeView can contain other nodes than SimTreeNodes you should use the as keyword to cast the node. If it's not a SimTreeNode it will return null.
---
b { font-weight: normal; }
|
|
|
|
|
Just been through this myself. Life would have been so much easier if the Treeview had a free property of type Object then we could have easily added a helper class with additional properties and methods. Anyway, back to your problem. I suspect you added your SimTreeNode as a TreeNode. You can only cast in one direction. You can cast SimTreeNode stored in a Treenode variable to a SimNode, But you cannot cast a TreeNode stored in a TreeNode variable to SimNode.
You used the word converting. That's not really appropriate as the objects are not converted. All it is doing is copying pointer. We know that the derived class has all the facilities of the parent class so casting from SimtreeNode to TreeNode is safe. If the compiler let you go the other way we would end up with:
TreeNode tn = new TreeNode()
SimtreeNode stn = (SimTreeNode)tn
stn.SomeMethodThatDoesNotExistinTreeNode()
So the compiler does not allow it.
Take a look in debug just as you execute the statement and make sure that you do objects of the type you needed. Overriding ToString is always useful when you extend TreeViews.
To ensure you are safe override in SimTreeView the Add method for a treenode and make it private. Then add your own Add method for SimTreeNode
Paul
|
|
|
|
|
Hi all !
In c#.net 2.0 , there is a class "Persian Calendar", and I want to use this class with DateTimePicker control so that this control(DateTimePicker) return(show) Persian date value . How can I do it ?
Thanks for any help !
Regrads ,
s_mostafa_h
|
|
|
|
|
|
hi !
there is an error in opening file . in vs 2005 , I can not open this file .
regards,
s_mostafa_h
|
|
|
|
|
hi all,
how should i prepare access so as to insert datas for date and time exactly like this :
date: 06/06/2006
and
time: 13:00
ps: i have an example database table. date's format is: short date and time's is: short time.
in database everything seems normal. but if i read data from database:
date becomes: 06/06/2006 12:00:00 PM
time becomes: 12/01/1988 13:00 PM
why i get these bold parts ?
what should i do so as not to get them ?
help please,
thanks in advance.
-- modified at 10:21 Tuesday 6th June, 2006
|
|
|
|
|
Why not put them into the same column then? Your dates are always going to show up like this in a date field. If you want it to be in the database in a specific format, make it a char field.
|
|
|
|
|
Because Access uses a date/time datatype and not seperate date and time types. If you provide only the date it will automatically use a default time and vis-vesa.
Just ignore them and read the date or time as appropriate. Or else store the date and the time as strings. Or if the problem is with how things look in Access you can specify the format within Access itself (but it will still be stored with a date and a time).
|
|
|
|
|
Hi there,
I'm quite exhausted now trying to directly set the Scan0 Paramater of a Bitmap to avoid slow copying bitmaps in memory.
Basically, I try to do the following:
1.) I have a buffer containing already loaded Bitmap files in memory. Fo r performance reasons, this buffer is allocated via VirtualAlloc and therefore unsafe.
2.) I'm passing a UnmanagedMemoryStream with a subportion of the buffer to my Drawing function, pointing to the beginning of the bitmap file.
3.) I'll try to instantiate a bitmap, using the Streampointer to use the buffer directly and draw it to the screen ( or better, a backbuffer).
This looks like this:
<br />
<br />
unsafe<br />
{<br />
UnmanagedMemoryStream mstr= new UnmanagedMemoryStream((byte*)buf.ptrStart.ToPointer(), buf.Count, buf.Count, FileAccess.Read);<br />
}<br />
BitmapData bmd;<br />
<br />
BufferBitmap = new Bitmap(1920, 1080);<br />
<br />
ImageLockMode fLock = ImageLockMode.UserInputBuffer;<br />
<br />
bmd = BufferBitmap.LockBits(new Rectangle(0,0,1920,1080),<br />
fLock,PixelFormat.Format24bppRgb);<br />
unsafe<br />
{<br />
bmd.Scan0 = new IntPtr(mstr.PositionPointer+14);<br />
}<br />
<br />
BufferBitmap.Unlock(bmd); <br />
<br />
GfxBuffer.Graphics.DrawImageUnscaled(BufferBitmap, new Point(0,0));<br />
<br />
Well, all I get is a "Invalid Parameter" Exception when setting the LockBits with the UserInputBuffer Flag, or, if I use the ReadWrite Flag, I would probably have to use the buffer the Bitmapobject manages, which would be an unnecessary copy operation. I just want to display the bitmap I've already in memory which the smallest possible effort.
Does anybody have an idea whats going wrong here ? According to some examples I found, it should work this way. Interestingly, even if a try to pass a buffer allocated with Marshal.AllocHGlobal the LockBits operation fails...
The buffer contains valid data, because this code works, but I think, this causes every time an instantiation and copy procedure:
<br />
<br />
Bye,
Florian
|
|
|
|
|
Hey Ya'll.. I'm building a little analyzer utility that will analyze text files automatically. Currently you have to click the Open Files button to load a file to analyze.
I'd like to mod this program so that if you double click the file you want to analyze, it will spawn the analyzer and automatically analyze the contents of the clicked file.
I've set my PC to always Open With the analyzer when you click on the files with my extension, but I'm at a loss on how to get the filename / path of the file that spawned it.
Can anyone point me in the right direction?
Thanks in advance
-Chris
|
|
|
|
|
Chris,
I'm going to assume that you've set the file type in Folder Options in Explorer to load your application automatically. In the Advanced dialog, you get the command line to run. Using %1 on the command line should give you the FQ path to the file that was double-clicked.
Change
"c:\program files\myapp\myapp.exe"
to
"c:\program files\myapp\myapp.exe" %1
Make your Main() into Main(string[] args), and args should contain the path/file that was clicked on.
Stephan
|
|
|
|
|
Got it.. Seems to be working great!
Thanks a lot!!
-Chris
|
|
|
|