Results 1 to 24 of 24

Thread: [RESOLVED] Programatically determine bindings on a textbox

Threaded View

  1. #1

    Thread Starter
    Not NoteMe SLH's Avatar
    Join Date
    Mar 2002
    Location
    192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
    Posts
    3,051

    Resolved [RESOLVED] Programatically determine bindings on a textbox

    I have a method that takes a LINQtoSQL object and a field name and will tell me the length of that field based on the attributes of that field within the class object.

    I want to use this method to set the maxlength of any bound textboxes in a gridview.

    I can loop through all textboxes, and if the textbox created from a bound field then i can get at the fieldname ok, however if it's created from a template i can't find any way of getting to the field name the textbox is bound to (since a template isn't bound to anything).

    What i'm after is a way of getting the field name the Text property of a TextBox is bound to in (ideally) any case, not just the case where it was created from a bound field.

    Any help would be great, if you want to answer in code c# or VB.NET is fine.
    Last edited by SLH; Jul 12th, 2010 at 08:03 AM.
    Quotes:
    "I am getting better then you guys.." NoteMe, on his leet english skills.
    "And I am going to meat her again later on tonight." NoteMe
    "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
    "my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
    Have I helped you? Please Rate my posts.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width