1

I want to check with you can I create a new row based on my current table template? I already check the other questions, all of them create new row based on creating all the columns again. I want to check can we make it dynamic?

I remembered in C# or Java we could create a empty row from current table (Or maybe Grid) then we use to add that column to the table and fill it but I cannot remember how or in which language it was!

Kindly please help me with how I can create add a new row to my table and remove a row from my table? I prefer to create my new row based on TableRow template that has been shared.

I want to write some code like below:

datarow dr = TblRFADetails.newrow;
TblRFADetails.add(dr);

Something as above. Please help me. I am using Asp.net v2.

<asp:Table ID="TblRFADetails" runat="server">
    <asp:TableHeaderRow>
        <asp:TableHeaderCell>Ticket No</asp:TableHeaderCell>
        <asp:TableHeaderCell>Ref No</asp:TableHeaderCell>
        <asp:TableHeaderCell>Information onTicket*</asp:TableHeaderCell>
        <asp:TableHeaderCell>Relevant</asp:TableHeaderCell>
        <asp:TableHeaderCell>Region</asp:TableHeaderCell>
        <asp:TableHeaderCell>RFA Remarks</asp:TableHeaderCell>
        <asp:TableHeaderCell>Classification</asp:TableHeaderCell>
    </asp:TableHeaderRow>
    <asp:TableRow>
        <asp:TableCell><asp:TextBox ID="RFA_NO" runat="server" /></asp:TableCell>
        <asp:TableCell><asp:TextBox ID="CUST_REF_NO" runat="server" /></asp:TableCell>
        <asp:TableCell><asp:TextBox ID="FIX_DESCRIPTION" runat="server" /></asp:TableCell>
        <asp:TableCell><asp:DropDownList ID="CLASSIFICATION" runat="server" /></asp:TableCell>
        <asp:TableCell><asp:DropDownList ID="REGION" runat="server" /></asp:TableCell>
        <asp:TableCell><asp:TextBox ID="REMARKS" runat="server" /></asp:TableCell>
        <asp:TableCell><asp:DropDownList ID="PROBLEM_CATEGORY" runat="server" /></asp:TableCell>
   </asp:TableRow>
</asp:Table>
0

1 Answer 1

1

Use a Repeater. You have to fill items into the Repeater and then bind them as the datasource. However, if you just want to create the rows dynamically, simply add a list of IDs or whatever to the Repeater. Then do your dynamic stuff in the ItemDataBound event.

Sign up to request clarification or add additional context in comments.

1 Comment

It's been a while. I have no code samples from that time any longer. Sorry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.