|
Hi all,
Can we able to populate a property grid using a A datatabel
For example, Like this
PropertyGrid1.SelectedObject=Datatable1
or some any other method exist
Thanks in Advance
Dana
|
|
|
|
|
A property grid simply doesn't work that way. You can't give it a bunch of database rows and expect it to display them.
A PropertyGrid control shows you the public properties of an object, like an instance of a TextBox, Label, DataGridView, ...
It does NOT show the rows of a database table. For that, you'd need to use a DataGridView, or some other bindable grid control.
|
|
|
|
|
Hi Dana,
You can put whatever you want in a PropertyGrid as long as you write a class that will publish the properties you want. It has to implement ICustomTypeDescriptor. If you drop it to the SelectedObject property, you will see the custom properties. With .Net 2.0 you can also use the TypeDescriptionProvider so that you don't have to modify your existing class (the DataTable) to make it implement ICustomTypeDescriptor. You will find some resources about this subject on the PropertyGrid Resource List.
If a commercial component is an option for you, you have also Smart PropertyGrid. It has a mode where you can simply call AppendProperty-like methods and fill the grid completely dynamicall without having to build separate TypeDescriptor classes.
I hope this helps.
|
|
|
|
|
Hi Nicolas,
Thanks for your reply
Can u please brief about this one
With .Net 2.0 you can also use the TypeDescriptionProvider so that you don't have to modify your existing class (the DataTable) to make it implement ICustomTypeDescriptor
Thanks to Dave also
Dana
|
|
|
|
|
|
My requirement
when I go to homepage and I enter username and password.
If it right,
popup dialog will be appears. In popup, three is a tree view.
I click data in tree view. it go to next page .
homepage and popup still open then i have 3 window
And I have some problem follow this
- I want to close homepage and popup page when i click data link in tree view.
how should i do?
Preaw
|
|
|
|
|
The best way to do this is to write your pages as controls, and populate them all on the one form, then you can show/hide controls and only ever have one form visible. The other option is to have the login popup as a child, and then get rid of that, and maintain your main form after that ( I assume the login form is a different size ). Also, you can close any form by calling it's Close() method.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
How to parse VBA script file in MFC ?
I want the following information from the VBA macro file,
1. Number of modules in the script.
2. Name of all the modules.
3. All the function names in the given modules.
Is there any scripting engine ?
Any help would be appreciated.
Thanks and Regards,
Paresh.
|
|
|
|
|
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i have a report generating system of some employees.when they r using the punching card their details will be stored in the database according to their id number.the report will be stored in some folder.after some timeperiod(we can set the time) the report should automatically send to the outbox of the employee's email id.(as we have stored employee's e mail id coresponding to his emp id.)
what is the code for this?pls explain the logic also.
"I am burning...the only thing rest in me is you..."
|
|
|
|
|
State your question clearly. Are you asking how to send an e-mail using VB.NET?
|
|
|
|
|
i am asking how to send e mail(a text file attachment stored in the system) using vb,there we can set the time to send.
"I am burning...the only thing rest in me is you..."
|
|
|
|
|
This is how I send e-mails using Gmail[^] (the code is in C#, but I guess you'll work it out).
MailMessage has Attachments[^] property, so there should be no problem to attach a file.
accessred wrote: there we can set the time to send
I think that you should use a timer in your application to send e-mail periodically.
|
|
|
|
|
|
will this automatically attach the report while sending?
anyway thanks very mch 4 ur help.
"I am burning...the only thing rest in me is you..."
|
|
|
|
|
Dim s As New System.Web.Mail.MailAttachment("Insert path to file here in form of a string")
.Attachments.Add(s)
--> adding a attachment to the message
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
thanks very mch.. i 'll update u the result.
"I am burning...the only thing rest in me is you..."
|
|
|
|
|
In VBA environment I have 2 Tabs Inv and Att. When I click on Checkbox in Inv and then click on the next tab which is Att and go back to Inv tab from Att the CheckBoxes in the Inv tab disappear.
So, my question is what should I change in the settings inorder for CheckBoxes in the Inv tab not to disappear?? I tried Hide Selection as False and tried MultiSelect as true but it does not work.
|
|
|
|
|
You have two tabs in what?? Access, Excel, Word, something else??? Is this a tab control?? What are these checkboxes sitting on??
There are no settings to change. There is something your code is doing to cause this or you're expecting functionality that isn't there by default.
|
|
|
|
|
I built a database driven application, when i tried to publish this by building my own setup project and what not, when i install and run the program i get errors saying it can't link to the database etc. Does anyone know why or, what's the proper procedure for publishing database driven apps, do i need to include the database in the setup file?
|
|
|
|
|
you need not to include the database file in the set-up project,but you have to install the database in the machine where the application is running.......moreover if its a client-server application then install the database in the server......
and finally check for the connection string whether it is pointing to the right database in the right machine or not......
Tirtha
Do not go where the path may lead, go instead where there is no path and leave a trail.
Author: Ralph Waldo Emerson (1803-82), American writer, philosopher, poet, essayist
|
|
|
|
|
ok. how do i install the database and what not and set the connection string correctly?
|
|
|
|
|
First, you have to say which database you're using. Sql Server, MySQL, Access?? Then you have to tell us what deployment method you're using. Is it ClickOnce, or a Setup and Deployment project, creating an .MSI installation, or something else??
|
|
|
|
|
Ok i'm doing a setup deployment project using an SQL database.
|
|
|
|
|
There's nothing to deploy. You can either build the connection string at deployment time using custom actions, or, a more flexible option, is you have this is a setting in your application and you create a new connection string using a template, filling in the server name.
|
|
|
|