Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6576627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:32:09+00:00 2026-05-25T15:32:09+00:00

I have the following struct defined in a user control: public struct ColumnData {

  • 0

I have the following struct defined in a user control:

public struct ColumnData
{
    public string ColumnName { get; set; }
    public string ColumnDataItem { get; set; }
    public bool ColumnIsHyperLink { get; set; }
    public string ColumnHyperLinkURL { get; set; }
    public string ColumnHyperLinkPK { get; set; }
}

I create a new instance of List<ColumnData> (In a different code behind that creates an instance of the user control) and want to pass in values to it, but how do I assign them to specific attributes within the struct object?

I create an instance of the struct using the following code:

List<ColumnData> DataItems = new List<ColumnData>();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:32:09+00:00Added an answer on May 25, 2026 at 3:32 pm

    Change that to a class; all your woes relating to modifying struct properties (etc) will go away.

    Alternatively, make it an immutable struct, and initialize it with the correct values at the point of creation – then the issue is moot, no matter how many times it is subsequently copied.

    IMO the first is the right approach here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a struct defined as the following: typedef struct { string foo; }
I have the following struct: public struct Declarations { public const string SchemaVersion =
I'm trying to read the bitmap header. I have defined the following struct: typedef
I have set up the following struct: typedef struct _thread_node_t { pthread_t thread; struct
I have the following base abstract class defined as: public abstract class BaseObject<T> :
I have two struct s defined as in the following: struct vertex { double
I have the following structure: [StructLayout(LayoutKind.Sequential)] public struct TCurve { public int fNumItems; /*
I have defined the following struct to represent an IPv4 header (up until the
I have a struct as defined by the following: typedef struct { NSString *SportName;
I have the following struct in C++: #define MAXCHARS 15 typedef struct { char

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.