|
Hi All.
can any one help me, How to filter/sort records in a datagrid according to the values which I type in a text box,
my problem is i have a dataset populated and am setting it as data source to my grid.my requirement is i need to sort the grid at runtime as and when i type some text in a textbox (relates to a col in the grid), associated in the same form, and then after filtering i should be able to update the colums in the grid.
select query is to be performed once only, and i need to work with the availabe dataset to filter/sort records
|
|
|
|
|
Create a DataView from your DataTable and set that as the DataSource for your DataGrid. Then change the DataView.Sort based on the text in your textbox.
|
|
|
|
|
|
Hi all,
I have an Outlook Add-In that uses it's own shim for an AppDomain and often (don't you just hate it when that happens) Outlook acts strangely.
What does strangely mean? Two things mostly; On moving off in a email in the .pst file that mail is deliver to, the mail is not marked as read. Secondly when dragging a "still marked as unread even though I have read it" mail message from the folder it is in to another folder you get the message "Can't move the items. The item could not be moved. it was either already moved or deleted, or access was denied". Interestingly this message does get copied, it's just the delete afterwards results in the error. Deleting the message manually afterwards is fine.
I assume that my Add-In is being called and throwing an exception that is resulting in the delete after copy failing but I have stripped out everything that it has and it still happens.
Is there a way to get Outlook to tell me what is going wrong inside?
Thanks,
_Goose
|
|
|
|
|
Hi there.
I ran into some problems. I created a small form (f1) and on it there is a button. When the button is pressed a second form is created (f2) and springs up. I can´t seem to create a menu for this new form (f2). I also put a simple Label control on f2 just for fun. I put some code into the eventhandler for the button but then all I get when the button is pressed is a menu on the underlying form (f1), not on f2 like I intended
Here is what happens when the button is pressed:
Form f2 = new Form();
f2.Show();
f2.BackColor = Color.White;
Label pa = new Label();
pa.Text ="Just for fun";
pa.Location = new Point (40, 110);
f2.Controls.Add(pa);
MainMenu MyMenu = new MainMenu();
MenuItem m1 = new MenuItem("File");
MyMenu.MenuItems.Add(m1);
MenuItem subm1 = new MenuItem("Hello");
m1.MenuItems.Add(subm1);
subm1.Click += new EventHandler(menu_selected);
Menu = MyMenu;
Can someone please help me ?
FJ
|
|
|
|
|
naglbitur wrote: Menu = MyMenu;
You are adding the menu to the form that contains the event handler there. Try:
f2.Menu = MyMenu;
|
|
|
|
|
It works, thanks a lot
FJ
|
|
|
|
|
Hi, I want to create a setup project. My c# project uses a Microsoft Access Database. Som how and where should i add this database file to my setup project so that the setup will then work?
Thanks!
|
|
|
|
|
You need to add it to the files you want to install. You can select the Files view through the project explorer (some buttons at the top of this explorer).
Be sure that the application loads the database from the directory it is running from (the application directory )
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi,
I can translate my application using the procedure described in the MSDN article 'Walkthrough: Localizing Windows Forms'. In that article, one one language is set, by instantiating a CultureInfo() in the constructor of the from and setting it on the current thread's CurrentUICulture.
But now, how do I dynamically (at run time) change the language that the UI is show in? I've tried calling InitializeComponent() after setting Thread.CurrentThread.CurrentUICulture but that doesn't work. I know I can have the user close the application and restart it so that I can set the correct CultureInfo() at the start of the program, but is there another way? Thanks.
cheers,
roel
|
|
|
|
|
You can set the currentculture property of the thread your in.
Thread.CurrentThread.CurrentCulture = New CultureInfo("nl-NL", False)
|
|
|
|
|
Hi,
Thanks, but that only works when doing it before the UI is created. I'd like to change the language of the labels, buttons etc. while the application is already running (through a menu option).
cheers,
roel
|
|
|
|
|
If you put the different language versions of your lable text etc. into separate resource files, you can change them on the fly by reloading the appropriate resource file and modifying the appropriate text yourself. Load the initial resource file at startup using the current culture, then reload when the user changes the language selection. A little painful, as you will have to manage retrieving all the appropriate strings by key, and updating the pertinent controls yourself, but it will work.
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
How to execute a function on the server upon closing of the application on a client side?
I have used the 'Page.Unload' command, but it is executing upon loading of the page and not upon the closing of that page.
What I need to do is clean up a 'LOGIN' table that carries the user ID and the SessionID if:
a- the user closed the appliaction by clicking 'x' at the upper right corner instead of the controlled 'logout' button, or
b- the user left his system un-attended and the session timeout after 30minutes.
Since in both cases, if he tries to log in again, it should not allow him if he already has a record in the 'LOGIN' table.
Any help on this is appreciated.
|
|
|
|
|
You cant detect if the user has closed the window.
Fill the Session_End method in Global.asax.(cs|vb) this can handle the things you want to do correctly.
WM.
What about weapons of mass-construction?
|
|
|
|
|
It is not going to that method!! I have placed a break point in the method, but it never goes to it! I even tried the Application_End, and it does not go there either untill all users are logged out, which is not my case.
|
|
|
|
|
Frndz,
i want to display my data in a horizontal pattern using a datagrid with 2 rows.
can someone plz tell me what settings do i need to make to achieve that ?
heading towards Geek-Age !
- Prasadd
|
|
|
|
|
Hi Frndz,
I don't quite get what you exactly have in mind.
You can always build a dataset containing two rows and the amount of columns needed for your data.
Bind the DataGrid to that DataSet and there you go. The DataGrid layout you need.
WM.
What about weapons of mass-construction?
|
|
|
|
|
Hi,
thanx for ur help
can you plz giv me some sample code for adding rows & columns to a Dataset ?
using that can i achieve a result Grid with [4 cols * 2 rows] ??
i shld also be able to use paging with that.
heading towards Geek-Age !
- Prasadd
-- modified at 8:06 Saturday 29th October, 2005
|
|
|
|
|
Hai all,
In my program an animation control is placed on the windows form. And the Avi file will be played when the form is loaded. Here the file path of the Avi file is assigned to the file name property of the animation control.
My problem is I want to make the program work when the program is deployed on different machines where the file path will be different.
I am placing the Avi file the with in the project folder it self.
Is ther any method to get the project folder path so that i can append the path to the file name.
Please help me
sukanyavarma
|
|
|
|
|
Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "my.avi");
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thank You Christian Graus,
It is working.
Thanks for your help.
I am a bignner in .net my learning curve is becoming lot more steeper because of the people like You and the code project.
Thanks a lot to all you people for your generous responces.
Sukanyavarma
|
|
|
|
|
I have an C# Winforms application that takes data in a small input file which happens to be in XML format. Prior to this, I gave the file a custom extension (let's call it .mya for example) and associated that extension with my APP, so when someone clicked on the extension, it looked for an app already running, and if it found it, it sent that as an argument, otherwise it loaded the file itself. The app then took the data out of the custom XML file (.mya) and, among other things, sticks the data on a column in a datagrid.
Now, I'd like to set things up so when someone goes to a file like this as an URL in IE or Firefox, it will recognize the extension and call up my app. To do this, I created my own MIME type "application/myapp", had the Apache web server on the other end send the file type as that content type in its HTTP header, and then wrote to the registry under MIME/Database/Content Type my new data. I added the extension string there as .mya I then tried it out with Firefox, and it worked just fine.
It did not work at all with IE. IE sniffs the file and says, "This is actually an XML file" despite the extension and renders it as such in the browser. If I encrypt or encode the file as binary, this may force IE but I'd prefer not to do that if I don't have to.
One possibility is to get this to work with IE, I have to generate a GUID for my app and and add it under my MIME registry key as the CLSID. Then, somehow I go to my app and register this as a COM object, and support the object passing.
All this seems quite complicated for something seemingly so simple. Anyone able to help me out -- perhaps there's a better way to do it. Or, perhaps generating the CLSID in the registry and then supporting that in my code is easier than I'm thinking.
Thanks a lot for everyone's help!
|
|
|
|
|
Hi all how is everybody hope good and fine
well i wanna to make a program which simulate the working of the Tower Of Hanoi i mean i will not do the towers of hanoi in console application i wanna to make a windows application and the users see the bars which he/she can move to the third column i know that i will use graphics to accomplish that but i dont know from where to start
hope anyone could help me in that
thanks in advance
byebye for now
Gego
-- modified at 22:29 Thursday 27th October, 2005
|
|
|
|
|
The old Tower of Hanoi problem. Isn't it a bit late in the year for people to get this as homework ?
A bar is achieved using the DrawRectangle method on the Graphics object. You should do all your drawing in the OnPaint method of your application. you don't need to create a brush, the Brushes enum will give you standard colors, the same is true of Pens. That should be plenty to get you started.
Christian Graus - Microsoft MVP - C++
|
|
|
|