|
Code using Windows/Web Forms have both "Code View" and "Design View". AFAIK, the IDE knows when to provide the "Design View" by checking the first class declaration in the codefile.
What if I create an alternate editor for a codefile, something like "Design View", is it possible to integrate it into the IDE? If so, can anyone give me a pointer or two to an article or documentation?
-Maki
|
|
|
|
|
Hey,
This is driving me up the wall!
I have a set of 3 grids.
They bind correctly as follows
//Parent Grid
dataGrid1.DataSource=parent;
//Child Grid
dataGrid2.DataSource=parent;
dataGrid2.DisplayMember="Parent.Child";
//Grand Child Grid
dataGrid3.DataSource=parent;
dataGrid3.DisplayMember="Parent.ChildToGrandChild";
The relation works beautifully.Been working for months now.
Here is the issue:
I have to filter out data in the child grid ie dataGrid2, which in turn will affect dataGrid3 which is fine.
so I have tried using the RowFilter property of the DefaultView exposed by the DataTable, but to no avail.
These are the methods i have tried.
1. ((System.Data.DataTable) dataGrid2.DataSource).ChildRelations["Parent.Child"].ChildTable.DefaultView.RowFilter = " [FilterMeNow] = 1";
does not work.
2. I tried setting up the filter before establishing the databinding but after the relation is set, again it wont work.
3. Googling it leads to me to think setting the row filter is the way to go....but nothing seems to happen.
I know RowFilter works because I have been using it for single grid all year long.
So how do i go about using it in master-child relation datagrid.
Am I just supposed to refresh the grids after they are bound, resulting in the row filter to take affect. If so, how?
A frusturated Looney Tunezez
Cheers!
<bold>Looney Tunezez
"If you build it....
.....BUGS will come!" -JB
Application.Run(new Form1(this.Dispose())); <--WHAT :wtf::confused::eek:
"Stability. What an interesting concept" - Chris Maunder
<bold>
|
|
|
|
|
Does anyone know how to clear the clipboard so that neither Windows or Office can use what was copied?
|
|
|
|
|
If your using the Clipboard class, all you need to do is use the SetDataObject(object, bool); version of SetDataObject . The bool parameter tells the clipboard wheather or not to clear its contents when your application exists.
If you wanted to clear the clipboard at the click of a button, or other control, then you'll have to P/Invoke the Win32 OLE function OleSetClipboard[^]. It takes a single parameter, a pointer to an IDataObject , but in order to clear the clipboard, you'll pass in null .
[DllImport("ole32.dll")]
static extern int OleSetClipboard(IDataObject pDataObj);
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
In my application there is requirement that once the application is started then other opened windows on desktop should not be visible to the user.
I want to know if there is any way by which I can minimize all the open windows (on desktop).
|
|
|
|
|
Yes, however you will need to P/Invoke several Win32 functions. Your P/Invoke statements will look like the following:
const Int32 SW_HIDE = 0 ;
const Int32 SW_SHOWNORMAL = 1 ;
const Int32 SW_NORMAL = 1 ;
const Int32 SW_SHOWMINIMIZED = 2 ;
const Int32 SW_SHOWMAXIMIZED = 3 ;
const Int32 SW_MAXIMIZE = 3 ;
const Int32 SW_SHOWNOACTIVATE = 4 ;
const Int32 SW_SHOW = 5 ;
const Int32 SW_MINIMIZE = 6 ;
const Int32 SW_SHOWMINNOACTIVE = 7 ;
const Int32 SW_SHOWNA = 8 ;
const Int32 SW_RESTORE = 9 ;
const Int32 SW_SHOWDEFAULT = 10 ;
const Int32 SW_FORCEMINIMIZE = 11 ;
const Int32 SW_MAX = 11 ;
[DllImport("user32.dll")]
static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
[DllImport("user32.dll")]
static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, IntPtr lParam);
delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam);
[DllImport("user32.dll")]
static extern bool IsWindowVisible(IntPtr hWnd);
The implementation part would look something like this if you were invoking this from a button click:
private void bClick(object sender, EventArgs e)
{
EnumWindowsProc proc = new EnumWindowsProc(MinimizeWindow);
EnumWindows(proc, IntPtr.Zero);
}
private bool MinimizeWindow(IntPtr hWnd, IntPtr lParam)
{
if(IsWindowVisible(hWnd))
ShowWindow(hWnd, SW_SHOWMINIMIZED);
return true;
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hello..
Plz could any one help me on how to embed a numeric updown column in a DataGrid..
And thanks..
bhshs
|
|
|
|
|
Does anyone know the equivalent of
SetWindowExt
SetViewportExt
in C#.
I have an old dll that i need to use which draw object to a device context using the resilution of the device, this is fine where the device is a screen e.g 96dpi but if I use my printer 1200dpi then the object being displayed is tiny, so I would like to scale it up by a factor of deviceDPI / 96.0.
does anyone know hoe to do this
|
|
|
|
|
How about something like the following:
[DllImport("gdi32.dll")]
static extern bool SetWindowExtEx(IntPtr hdc, int nXExtent, int nYExtent, IntPtr lpSize);
[DllImport("gdi32.dll")]
static extern bool SetViewportExtEx(IntPtr hdc, int nXExtent, int nYExtent, IntPtr lpSize);
- Nick Parker My Blog | My Articles
|
|
|
|
|
HI,
I have add Refernce to COM DLL in ASP.NET.
Now how can i use it, means create its object
and calls its Functions etc,
DLL name is COMDLL.dll
and after creating its refernce nameis Interop.COMDLLLib .
so how i can use it
thanx
Regards.
|
|
|
|
|
One, you haven't set a reference in ASP.NET. ASP.NET is a technology, not a language...
You've set a reference to the .DLL in your C# project.
Second, without the docs on the .DLL, you're pretty much groping around in the dark.
What is this .DLL supposed to do? Where did you get it from?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am using FileSystemWatcher component to monitor a folder for file creation. My folder is basically an FTP folder where file take time to upload, but as its creation starts, file creation event is raised.
Now when i get the file size at the same time, it gives returns me 0 bytes. Kindly tell me how to deal with this issue. how to check if file creation is complete.
Also how can i know if a file has been fully copied???
Thanks in advance
|
|
|
|
|
I had a similar problem, I dint find any direct approaches like filecopied event or something similar,may be this will be of some help.
Use the Changed event, select the LastWrite notify filter.
u will get approx 3 events raised for each file activity.
keep a counter when it has reached 3 u can be relatively
sure that the file has been fully copied then u can check for file size.
cool man
|
|
|
|
|
There really seems to be no built-in way to do this.
Usually to determine if a file has been copied completely you try to open the file with exclusive access (for example using a File.Open() overload), and if this fails you know that another program is still accessing (i.e. copying) the file.
If the
Repeat until your File.Open() succeeds (or a certain number of retries has been made to avoid deadlocks).
Regards,
mav
|
|
|
|
|
Hi,
I'm a bigginer in programing C# and I have a simple problem that and I hope some one can help me out. I'm sending IP multicast from a server and after 10 packets I want to make a break for 10 sekunds before I transfer the next 10 packets. So my question is basically what is the command for making a delay?
Thanks in a million
|
|
|
|
|
hi,
If you are using threads then you can go ahead with the method
Thread.Sleep(1000)
parameter is in millisecond.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I want to do a user control. It can input number only and can check Integer's length and real's length. Can give me a sample?
|
|
|
|
|
hi,
Create a user control with a textbox or something. And provide a error provider which you will get from toolbox.
private void textBox1_Validating(object sender, System.ComponentModel.CancelEventArgs e)
{
if(textBox1.Text.ToString().Length > 5)
{
errorProvider1.SetError(textBox1,"can't be > 5");
}
else
errorProvider1.SetError(textBox1,"");
}
See this is a small hint to achive. Remaining is upto you to develop. And don't expect entire source code from here.
;P
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
int year = int.Parse(cboYear.Text);
int month = int.Parse(cboMonth.Text);
int day = int.Parse(cboDay.Text);
System.DateTime moment = new System.DateTime( year,month,day);
string dMy = moment.ToShortDateString();
string test_SQL = "Select * From test Where startDay <= " + (dMy) + "And endDay >= " + (dMy);
System.Data.OleDb.OleDbCommand test_cmd = new System.Data.OleDb.OleDbCommand (test_SQL, test_conn);
System.Data.OleDb.OleDbDataAdapter test_adapter = new System.Data.OleDb.OleDbDataAdapter(test_cmd);
System.Data.DataSet test_ds = new DataSet(); test_adapter.Fill(test_ds,"test");
// bind datagrid to dataset
dataGrid2.DataSource = test_ds;
dataGrid2.DataMember = "test";
test - table name
startDay (MM/dd/yyyy)- column name
endDay (MM/dd/yyyy)- column name
when the user select the date, month and year, my program will grab this value and compare it into the database. if found, it will display into the datagrid. i wanna use the date format (MM/dd/yyyy) to compare those in the database. Is not working!!!! help!!!!
Chris
|
|
|
|
|
hi,
After getting the date from user. here this line
System.DateTime moment = new System.DateTime( year,month,day);
Suppose your date is (value of moment ) 22-05-2004
You can convert it into string like
string dMy = moment.ToString("mm/DD/yyyy"); result will be->05/22/2004
string dMy = moment.ToString("dd/MM/yyyy"); result will be->22/05/2004
string dMy = moment.ToString("dd-MMM-yyyy"); result will be->22-May-2004
string dMy = moment.ToString("mmm-DD-yyyy"); result will be->May-22-2004
i think this will serve your need.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
thanks but it doesn't work. in my database, for example the startDay is 1/10/2005. whereas in my program, after extracting the date value from the user, it displays as 01/10/2005.. will there be any problem if there is a zero infornt ->01/10/2005 whereas in my database is just 1/10/2005???
|
|
|
|
|
hi,
please check the date format of your database. i can't figure out this.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
My directory always get much temporary files after compiling. I always need to pick source files (like *.cpp, *.h etc) one by one when I want to copy them to another folder or backup them. It's so pain
Fortunately, I found a program today, it's very useful to me, maybe it's useful to you too. It can copy or clean specfied type of files and integrate with Explorer, very easy to use.
It's name is Clean Now!(http://www.liuxz.com/cleannow/index.htm) I have installed it in my computer and feel good Usually, I develop with VC6 and C++Builder 6. So I create my own "File Group" like following:
VC 6 Source Files: dsw;dsp;cpp;c;h;hpp;def;clw;lib;opt;rc;ncb;
CBC 6 Source Files: h;hpp;cpp;c;lib;dfm;res;bpr;bpg;
Now, it's very easy to copy my source files to another folder or backup them without garbage: (1) Right click at my source folder (2)Move mouse to "Copy"->"VC 6 Source Files" (3) Select a destinition folder. After a few seconds, all source file and only source files will be copied to destinition folder. I don't need to pick them manually anymore!
If I don't want to copy them out, I just select "Clean"->"VC 6 Source Files", and HOLD SHIFT while clicking. All files EXCEPT source files will be deleted. My source folder become clear
You can try it out if you have interest
code, debug, code, debug ...
I love it!
|
|
|
|
|
hi,
don't post these sort of information here. Go for some other section like soap etc
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
If I have a datatable I want to bind to a listbox, how can I make the valueMember equal two columns instead of one ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|