Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

read value from item array in user control

$
0
0
Hi,

I have created a user control with txtFirstName and txtLastName fields on it.

On my frmPassengers, I am populating the user control more than one time based on the number user decided to add like this:

private void frmPassengerDetails_Load(object sender, EventArgs e)
{
    this.Cursor = Cursors.WaitCursor;

    BaseLayoutItem prevItem = layoutControlPassenger.Root;

    for (int i = 1; i < total_adults; i++)
    {
        ctlPassengers uc = new ctlPassengers() { PassText = "Passenger " + i };

        LayoutControlItem item = layoutControlPassenger.AddItem("", uc, prevItem, DevExpress.XtraLayout.Utils.InsertType.Bottom);
        item.TextVisible = false;
        item.SizeConstraintsType = SizeConstraintsType.Custom;
        item.MinSize = new Size(830, 75);
        item.MaxSize = new Size(830, 75);
        prevItem = item;
    }
}



so if user choosed 5 for the total_adult value then the user control will be populated five times.

Now I want to know how can I read the value of every txtFirstName and txtLastName on the form (the five of it for example)..



Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>