I was wondering if there is a way to automatically copy the first value of a row in a grid to all the remaining rows. For example, if I have two columns A and B, and I input a value in column B at the first row, can that value be automatically populated in all other rows?
**Serial** **CartNum** Output **CartNum**
1 1 1
2 1
3 1
4 1
Is this achievable? I am working with ASP.NET (VB) and JavaScript for this task.
Below is the code snippet for my grid:
<div class="Scrolls">
<asp:DataGrid runat="server" ID="dgSerial" AutoGenerateColumns="false" ShowFooter="false" ShowHeader="false" GridLines="None" DataKeyField="BaseLineNum" AlternatingItemStyle-CssClass="AlternateGrid">
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<table border="0" style="border-bottom: 1px dotted; border-color: #FF0000">
<tr>
<td style="width: 20px;">
<asp:CheckBox runat="server" ID="chkSelect"></asp:CheckBox>
</td>
<td style="width: 120px;">
<asp:TextBox Width="120" ID="SerialNum" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "SerialNum")%>' />
</td>
<td style="width: 120px;">
<asp:TextBox Width="120" ID="CartNum" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "CartNum")%>' />
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>
</div>
I appreciate any insights or guidance on how to achieve this functionality. Thank you!