VS 2010 [RESOLVED] Is there a way to store a custom object in a DataRow or DataColumn?-VBForums
Results 1 to 6 of 6

Thread: [RESOLVED] Is there a way to store a custom object in a DataRow or DataColumn?

  1. #1

    Thread Starter
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    Resolved [RESOLVED] Is there a way to store a custom object in a DataRow or DataColumn?

    Is there a way to store a custom object in a DataRow or DataColumn?

    Basically I'm looking for the equivalent of a tag property for a DataRow or DataColumn. I looked into ExtendedProperties for the DataColumn but you can only store strings there.

    Code:
     
           drNewPathRow = dsOutputGrid.Tables("dtPathElements").Rows.Add()
           elm = pth.Elements(iElements)
           drNewPathRow(0) = elm.Name
           
            '  drNewPathRow.tag = elm .... I wish!
    _____________
    Tim

    If anyone's answer has helped you, please show your appreciation by rating that answer.
    When you get a solution to your issue remember to mark the thread Resolved.


    reference links

  2. #2
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Is there a way to store a custom object in a DataRow or DataColumn?

    You can extend the properties of a datagridview not sure about colums

  3. #3

    Thread Starter
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    Re: Is there a way to store a custom object in a DataRow or DataColumn?

    I appreciate the input but I really need to attach the object directly to the datarow or datacolumn object versus accessing the datagrid ( in this case an infragistics ultragrid )
    _____________
    Tim

    If anyone's answer has helped you, please show your appreciation by rating that answer.
    When you get a solution to your issue remember to mark the thread Resolved.


    reference links

  4. #4
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,194

    Re: Is there a way to store a custom object in a DataRow or DataColumn?

    While this may not be a solution that you'd want to hear, you could create a List of whatever object it is that you're wanting to store and have that coordinate with your columns/rows. Any time you adjust the column/row collection, you'd adjust it's List.

  5. #5
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    3,415

    Re: Is there a way to store a custom object in a DataRow or DataColumn?

    You could add a column of type object to the datatable,
    Code:
            dt.Columns.Add("objCol", GetType(Object))

  6. #6

    Thread Starter
    Addicted Member thetimmer's Avatar
    Join Date
    Jan 2014
    Location
    Plano, Texas
    Posts
    243

    Re: Is there a way to store a custom object in a DataRow or DataColumn?

    wes4dbt , The answer I was hoping for, didn't know you could do that. thanks.
    Last edited by thetimmer; Nov 5th, 2014 at 04:03 PM.
    _____________
    Tim

    If anyone's answer has helped you, please show your appreciation by rating that answer.
    When you get a solution to your issue remember to mark the thread Resolved.


    reference links

Tags for this Thread

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.