Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 534
  • Last Modified:

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

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
Chuck98RT10
Asked:
Chuck98RT10
  • 2
1 Solution
 
phead_2Commented:
This is for a table web control right? How are you assigning the ID to the row?
0
 
ddayx10Commented:
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
 
Chuck98RT10Author Commented:
Nevermind. I think I figured it out. Thanks for replying.
0
 
Chuck98RT10Author Commented:
Got it. Thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now