|
SekharOne wrote: I wanted to know when the bindingsource's binding data getting completed.
There's no way to know that. The BindingCompleted event fires for EACH field in the row, not when the entire row is done all at once.
SekharOne wrote: the textbox's value gets changed and so does the value of the boolean variable.
Why are you using the Textchanged events of the TextBox's?? You don't have to.
SekharOne wrote: and when the user clicks on the next,previous buttons it should track whether data on the form has changed or not.
I showed you that. It fires when any field in the current row changes.
SekharOne wrote: And if changed it should ask the question.
This I misunderstood. The changes you make in the textboxes get made to the underlying DataSet. Unless you want to commit the changes to the database while leaving each changed row, you would normally just track if the dataSet is dirty and needs to be written back. Doing this on every change to the dataset would be a bit excessive.
But, if this is what you want, then you reset the dirty flag only after you call Update on the DataAdapter and write the changes back to the database.
|
|
|
|
|
Hello,
I have an error for using UDL file for connection strings in VB.NET.
Dim oConnection as New SqlConnection
oConnection.ConnectionString = "..\..\Connections.UDL"
It raises "Format 0" Exception.
Kindly let me know How to using udl file in VB2005.
Thanx,
Kumaresh
|
|
|
|
|
The error is telling you that the contents of the file are not valid for a UDL file.
I'm wondering why you're even bothering with it considering it's an outdated concept and everything in a UDL file can already be done in using a connection string in your app and storing connection strings in your app's config file.
|
|
|
|
|
Hi Dave,
I find the solution. That UDL file works on OLEDBConnection but I was using SQLConnection.
Thanks,
Kumaresh
|
|
|
|
|
Again, UDL files are an obsolete concept.
If you want to use OleDb on an SQL Server, go ahead. Just remember you're sacrificing performance and features specific to SQL Server if you do.
|
|
|
|
|
Hi,
Can somebody please tell me how to manage the property grid dynamically (i.e)
there are 50-100 properties in my database and not all are assigned values, i want to display only those properties which have values assigned..
can somebody suggest me some method for this.
i would be a great help.
Thanks in Advance
Anu
|
|
|
|
|
You cannot use a PropertyGrid for this. A PropertyGrid shows the public properties of an object, like an instance of a TextBox, or Label control.
You're need to use something like a DataGridView control, or some other bindable grid control to show your database data.
|
|
|
|
|
Hi,
simply write a class implementing ICustomTypeDescriptor and drop it to the SelectedObject property. This class will take care of publishing the properties it wants. With .Net 2.0 you can also use the TypeDescriptionProvider so that you don't have to modify your existing class 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.
|
|
|
|
|
I think both of these guys are doing the same thing. My take on what they were doing was storing storing a bunch of name/value pairs in a database (they call them "properties"), then expecting the PropertyGrid to show those records. This, obviously, won't work in a straight forward manner by pointing the SelectedObject of the PG at the DataTable object. You'll get the properties of the table, not the data in it.
Are you saying you would either create a custom class deriving from CustomTypeDescriptor or modifying an existing class, implementing ICustomTypeDescriptor, to wrap these name/value pairs as a PropertyDescriptorCollection?? Wouldn't you also have to extend the schema of the datatable to include, at a minimum, type information for each "property"??
|
|
|
|
|
Hello Dave,
There is not a lot of detailed informations in the original post. So I gave a generic advice since the OP seems to ignore that the PropertyGrid can display something else than the simple sum of the public properties in a target instance. How he will get the data in his business objects and how he knows their type is beyond my knowledge of his application.
|
|
|
|
|
I'm just guessing at their applications too.
But, any time I come up with, for example, a settings class, it usually involves a serializable class full of properties, custom types, editors, and maybe a little custom serialization code, then wrapping a UI around it, customized for that class and/or a little more generic, like using a PropertyGrid.
As you probably know, adding new properties to a class like that results in "some" extra work and versioning issues. What I'm curious about is making that process more generic, where I could get away with, say, dumping a bunch of settings name/values into a database or other collection, along with the respective type information, and exposing it to a PropertyGrid through a ICustomTypeDescriptor implementation.
Hmmm...
|
|
|
|
|
If it is for end user (versus a quick and dirty object property view for developers), property grid is not a good control for it. Probably that's why it's not included in the toolbox by default.
You can add an attribute Browsable (System.ComponentModel.BrowsableAttribute)to true or false but I don't think you can change it dynamically.
|
|
|
|
|
The Microsoft PropertyGrid, in the way it is available to the developer, is not really suitable for the end-user. It's not flexible enough and does not offer enough customization options. But a PropertyGrid in itself, is really suitable in so many cases... If it's done well, it can do the job better than any other control. I have written a paper some time ago showcasing a lot of examples in the industry: Why use a PropertyGrid in your application?
|
|
|
|
|
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..."
|
|
|
|