.net - Create Custom DataTable Which Is Bindable To WinForms Controls?

Aug 25, 2011

Our shop primarily use "ADO objects" (I'm referring to DataSet, DataTable, and DataRow) for marshaling around data and manipulating it on forms and in grids. We are experimenting with creating shop-flavored counterparts to the native ADO objects so that we can impose our in-house standards on top of them. Implementing this is straightforward with one exception: I want our objects to be bindable to controls.

I'm aware of IList, IBindingList, BindingSource, etc. and have looked at and experimented with these, but I am falling short when it comes to making a class with no hard property names bindable. The native ADO objects are not strongly typed by default. You have column values that you access via the Item property (e.g. row("Age") or row.Item("Age")). The binding examples I've found online deal with strong-typed objects (e.g. row.Age). Essentially, we want to create custom ADO objects (not inherited from the native ones) that still retain their ability to bind to controls. In a grid I would expect to see columns Name, Age and Occupation from a row where these properties are exposed via row("Name"), row("Age") and row("Occupation"). This must be doable as this is exactly what the native DataTable and DataRow provide.

View 1 Replies


ADVERTISEMENT

Custom Made Bindable Structure?

Oct 1, 2009

As a coding exercise, I would like to know if it is possible to build a bindable data structure that would have a dynamic collection of field objects, in which each field not only would have a specific data type, but also would hold the value for that field. That is, is not like a DataTable where you can have many rows, I only want to manage a single collection of values.

View 4 Replies

Winforms Data Binding: Custom Classes Or Datatable?

Jul 8, 2009

Am in the process of architecting a new windows forms application, and I intend to use Visual Basic 2008 and SQL Server Express 2005. This is my first application in .Net and I really want to observe the best OOD & OOP principles to create an application that is easy to maintain and extend (add new functionality). My issue is in regard to databinding on the UI. From experience, what do you guys recommend to use for databinding? Should I return datasets/datatables from my Business Layer and bind these to UI controls or should I return Business Objects and bind these to UI controls? And what are the pros and cons of each approach?

View 1 Replies

How To Create Custom UI / Controls

Mar 19, 2011

I would like to expand my knowledge of VB.NET and was looking at creating custom user interfaces or custom controls. The type of things I am thinking of is: [URL]s. How are those controls created? I imagine it involves using the existing controls in Visual Studio as a starting point, and altering them to suit your design?

View 2 Replies

Create Custom Controls For Apps?

Oct 14, 2011

i need to create custom controls for my apps so how can I do that? Do I need a special software to do that?

View 3 Replies

C# - How To Create Custom Controls Containing Populated Lists

Sep 11, 2011

How to properly create custom controls containing populated lists?For example: I need a combobox control which contains a list of products, then I would reuse this control in other project.

[Code]...

and it works but when I run the project each item is duplicated - this is because list is populated twice. First when user add a control to form, second by designer when project is started.I already found a solution to prevent adding items in edit mode, but this is not what I need. I would like to have them existing in edit mode so they could be edited at this point.

View 1 Replies

Create And Build Custom Controls In 2005?

Mar 16, 2010

Can someone point me in the direction of a good tutorial on creating and building custom controls that can be added to the Toolbox?

View 6 Replies

IDE :: Set Project Default For Winforms Projects S/ Default Modifier For Controls Added To Winforms Is Private

May 28, 2010

Is it possible to set a project default for VB.NET winforms projects so that the default Modifier for controls added to winforms is Private (not Friend)?I know there's a "modifiers" property in the properties window so I can set it for each individual control however I would like to change the project so from now on myself and other developers have to specifically decide to change from friend to private. (Which I would strongly discourage them from doing).I believe there is no way of doing this, but on another forum a while ago someone mentioned it would be possible with an add-in (but didn't name the add-in or where to get it).

View 1 Replies

Wpf - Bindable LINQ (BLinq) ?

May 29, 2009

I cannot get Bindable LINQ to work with VB.NET for the life of me. How do I get the .AsBindable extention to appear?

[code]...

Imagine I magically come up with a collection full of items. I'll stry something like the following

DataContext = From G In TheList.AsBindable Order By G.Name

But I get an error on .AsBindable that "AsBindable is not a member of TestList"

View 1 Replies

Custom Sub Main For WinForms Applications?

Mar 3, 2011

I'm interested in building my own basic Application controller and ditching the Application Framework entirely.Never done this before (or even considered it) but now I'd like to be able to cut out anything that stands in the way of making my App compatible with both DotNET and Mono, for which Microsoft.VisualBasic.ApplicationServices is pretty famous.I start, or links to sample Main Modules for WinForms online? Seems like most of what I find is for Console apps.

View 8 Replies

Winforms - Custom Constructors For Forms In .net?

Nov 1, 2010

I would like to open a new form from some other form, and pass some selected object from a control on that form to the new form. The sensible way to do this, I thought, was as a parameter to the forms constructor. Now I know that the visual studio GUI creates partial classes for my forms, that hold the properties that I can drag onto there in the designer. I assume it also holds a default constructor. Since it might do all sorts of stuff that is needed to initialise the form, I figured I should call it from my custom constructor ala

public sub new(byval my_parameter as Foo)
Me.new()
Me.my_parameter = my_parameter

[code].....

That clearly wasn't it, because it can't find a default constructor. The thing is, visual studio goes trough great lengths to prevent me from seeing the generated constructor, so I know how to access it. This leads me to believe that I am actually doing it wrong, and should have set out on some different path, as the path you are forced in to usually is the sensible thing to do, which I usualy find out way too late.

View 3 Replies

Asp.net - Make Enum Bindable To Datagridview

Dec 10, 2009

I have an object which contains a number of string properties and an enum property called CRAction.

I have another object which represents a collection of the above object.

When I bind the collection object to something like a gridview, all of the string properties bind fine, but the enum doesn't appear.

I have added another string property which returns CRAction.ToString, but is there a better way to make an enum bindable to a control as part of an object?

It all seems a little hackish to have another property for the same thing purely for data binding!

View 1 Replies

Winforms :: Controls Not Visible?

Mar 26, 2012

I am trying to see all the labels in Me.Controls and when I use:

For Each Control As Label In Me.Controls.OfType(Of Label)()
MsgBox(Control.Name.ToString)
Next

it only shows the labels that have NOT been renamed

View 1 Replies

VS 2008 Using Custom Membership Provider In WinForms?

Feb 8, 2010

I would like to use my custom membership provider (which is working in my asp.netapplication) in my windows forms application.I thought this would be relatively straight forward, and followed these steps:1. Copied MembershipProvider class into my application.2. Add reference to System.Web3. Create app.config with membership settings i.e:

View 3 Replies

Winforms - Adding A Custom Button In Title Bar?

May 30, 2011

I was just wondering if there was a possible way to add a custom button into the title bar using VB.NET. I've seen many such questions on Stack Overflow but failed to get a sure-shot and a working answer.

View 3 Replies

Winforms - Use Custom Roles For User Access?

Sep 2, 2009

I have a winforms (VB 2008) based app that I'm developing and I want to use custom roles for user access.Application Layout:I have a Main form that opens a login form when certain actions occur.The Login form intern uses an authentication class that I've created, to authenticate users and set access rights.On my Applications settings page, I have Authentication Mode set to Application-defined because I cannot use Windows Authentication in the environment where this will be deployed.

The application uses a MS SQL 2005 db and the 3 tables I'm using in the authentication process are the User_Account , User_Roles and User_Access tables. The combination of an account in the User_Account and the roles within the User_Roles table are the bases for the User_Access table. Using the User_Access table is how I assign access to the various functions within the application

Authentication Method:To authenticate a user, I'm using the "My.User.CurrentPrincipal" (Code below) method. The My.User object works great and allows the use of "My.User.Name" property throughout the app when referring to the currently authenticated user.

Access Method:In order to set the current users access levels I'm using a function within my Authentication class and passing in My.User.Name as a variable. The function uses a Dataset Table Adaptor and a Select Case statement inside a For loop to assign all the access levels for the user (Function code below).

My Problem:This method of assigning access rights to a user does work but it's not persistent throughout the application as the My.User object is.I would like to find a way to create custom roles through the My.User object using its .IsInRole property. I would like to have these roles dynamically created using my User_Roles table.This would allow the custom roles to be used throughout my application using the My.User.IsInRole ("MyRole")syntax ...similar to how I'm currently able to use My.User.Name.Unfortunately the only roles I can currently validate against are the built in Windows
type accounts (Adminisrator ...ect.).

'User Authentication example:
If Authenticate.CheckPassword(tbxUserName.Text, strPassword) Then
My.User.CurrentPrincipal = New GenericPrincipal(New GenericIdentity(tbxUserName.Text), Nothing)[code].....

View 1 Replies

C# - WinForms Table Control That Can Contain Other UI Controls?

May 22, 2012

I am currently developing a WinForms application in C# and require a table control that can contain other UI controls.In the following example, I would like the Links column to contain link label controls:

| ID | Name | Links |
-----------------------------------
| 1 | n1 | link1, link2, link3 |
| 2 | n2 | link1 |

Is there one I can use 'out of the box', are there any good third party ones?

View 1 Replies

Multiple Controls From Different Sources In Winforms?

Aug 12, 2009

Has anyone tried using controls from different sources into their application that uses winforms? Will these combination of controls work together?

View 3 Replies

Over 60 Free Controls For WinForms - ASP.Net And SilverLight

Jun 10, 2011

I may have mentioned it before but I can't find a thread in this forum where I may have previously mentioned this!!

[Code]...

View 1 Replies

Sql - Equivalent For Value-property For Controls In Winforms?

May 3, 2012

I'm used to webdeveloping, and when I work with databases, I usually use some text for the Text-property of a radio button, and the row's ID as Value-property. This makes it very easy to save to databases.

Is the an equivalent in winforms for the Value-property, or will I have to identify rows based on the text in the control?

View 2 Replies

Winforms - Drag Data From DG And Other Controls To Another DG?

Feb 15, 2012

I have form in VB.Net 2010:

I want to click-drag multi rows in dgRegister and Date, Course ID to drop in dgCourseStudent with column Date, Register ID, Register Name and Course ID.

How to code this in vb.net language?

View 1 Replies

WinForms - How To Set Tab Controls In Specific Order

Oct 21, 2009

I have a bunch of buttons on a form and when the person presses TAB I want the focus of the controls move in a specific order.

View 3 Replies

Create A Custom Messagebox, With Varying Number Of Buttons With Custom .Text Descriptions?

Feb 6, 2009

This is what I would like to achieve:To create a custom messagebox, with varying number of buttons with custom .Text descriptions, and other features. I intended to have a property array that would be redim-ed and have values (.Text values) set by the calling class:

[code]...

View 7 Replies

Specify A Custom Icon For Display In The Toolbox Window When Create Own Custom Control?

Dec 29, 2011

how to specify a custom icon for display in the toolbox window when you create your own custom control? Something other than the dreaded "gearbox" icon.

View 2 Replies

Develop A Custom WinForms Data Source Control?

Nov 6, 2009

How can I develop a custom data source control for WinForms ? This example is just for ASP.NET. VS version: VS 2008

View 7 Replies

WinForms - Dynamically Adding Controls At Runtime

Oct 21, 2009

I have a WinForms application that I need to dynamically add controls to at runtime. I searched for this and I was initially led to the TableLayoutPanel (TLP).

View 4 Replies

WinForms: Locating The Relative Position Of Two Controls

Jul 9, 2010

I'm writing a VB.Net WinForms application that has multiple data girds on any given form. On one such form, the data grids are loaded into split containers which in turn are located on a tab control. The load method for each data grid is threaded so that an animated "Loading" form can be shown. I would like to position the new loading form (which is smaller than the grid) on top of, and preferably in the center of, the grid that is loading. Whats the easiest way to find the grids location within the main form so that I can adjust the loading forms location?

View 1 Replies

WinForms - Editing Custom Readonly Collection In Property Grid

Feb 19, 2010

I have a custom collection, lets says COL, that derives from ObjectModel.Collection. I have my own collection editor that works fine when a property, of type COL, is Read and Write enabled. However, if I change the property to ReadOnly, the open editor button stops showing in the property grid. As a test, I override my custom editor with the CollectionEditor, and that worked fine. So, my question is, what check is the property grid making, that CollectionEditor passes but my collection editor fails?

View 2 Replies

SQL Data Access: VB2008 / VB2010 - WinForms - Create A Datasourse And Drag / Drop Fields Or Tables On A Form To Create A Grid

Oct 22, 2010

I have used VB (versions 2 - 6) through many years; however, I am crash-course training myself into the VB2008 / VB2010 world kicking a screaming. I would like suggestions as to what SQL database access method should I focus more on in my learning process without making me feel that I'm a million years behind. I know I have WinForms where I can create a datasourse and drag / drop fields or tables on a form to create a grid (not really what I'm looking for).

My trouble isn't so much designing the form but in how I access the database. Theres XML, LINQ to SQL, ADO.NET, and many other methods. Not only do I need to grasp these methods quickly but I also need to know what type of projects I should create. What I mean is...I was thinking that I would design a WinForm app; however, I see that there are WPF apps and others to chose from. This is getting deep. I know it depends on the project that I'm working on. My plans are to write an app based off of either an SQL Express 2008 or SQL Server 2008 database. This first app will be standalone for now but may later become multi-user. I know I'm far behind on my learning curve coming from VB6. I have read a bit on VB2005 / 2008 / 2010. I own
both VB2008 and VB2010. I use VB2008 at work. I know ADO.NET is still alive but by what I read online, it's a dying method and is only kept for backward compatibility. XML and LINQ to SQL and other methods are all pretty new to me.

View 1 Replies

Create A Custom File Association ( A Custom Extension ) In VB?

Dec 19, 2010

know how to create a custom file association ( a custom extension ) in VB .Net and how to open it on the application

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved