Solved

C# find a row by ID and add tablecell to it

Posted on 2009-05-13
4
490 Views
Last Modified: 2012-06-27
The table and rows are already built.
Rows are assigned an ID.
I know what the ID is and want to add(tCell) to a specific row.
How do I reference a specific row so I can add a cell to it?
tCel.text = "howdy";

tRow.Cells.Add(tCel);

Open in new window

0
Comment
Question by:Chuck98RT10
  • 2
4 Comments
 
LVL 2

Expert Comment

by:phead_2
ID: 24379919
This is for a table web control right? How are you assigning the ID to the row?
0
 
LVL 20

Accepted Solution

by:
ddayx10 earned 500 total points
ID: 24380392
pretty limited info, but I'll take a stab at it:

        foreach (TableRow r in tbl)
        {
            if(r.Cells[<INDEX OF YOUR ID CELL>] == <YOUR ID>)
            {//add your cell}
        }

Good Luck,

dday
0
 

Author Comment

by:Chuck98RT10
ID: 24380859
Nevermind. I think I figured it out. Thanks for replying.
0
 

Author Closing Comment

by:Chuck98RT10
ID: 31581211
Got it. Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now