Hi nabilabolo,
Check this example. Now please take its reference and correct your code.
Controller
public class HomeController : Controller
{
public ActionResult Index()
{
List<Data> chopNos = new List<Data>();
chopNos.Add(new Data() { A = "A1", B = "B1", C = "C1", D = "D1", E = "E1", F = "F1", G = "G1", H = "H1", I = "I1", J = "J1", K = "K1" });
chopNos.Add(new Data() { A = "A2", B = "B2", C = "C2", D = "D2", E = "E2", F = "F2", G = "G2", H = "H2", I = "I2", J = "J2", K = "K2" });
ViewBag.chopNo = chopNos;
return View();
}
public class Data
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
public string D { get; set; }
public string E { get; set; }
public string F { get; set; }
public string G { get; set; }
public string H { get; set; }
public string I { get; set; }
public string J { get; set; }
public string K { get; set; }
}
}
View
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
$('#tblChopNo tbody td').click(function () {
var tds = $(this).closest('tr').find('td');
$('#txtA').val($(tds).eq(0).html());
$('#txtB').val($(tds).eq(1).html());
$('#txtC').val($(tds).eq(2).html());
$('#txtD').val($(tds).eq(3).html());
$('#txtE').val($(tds).eq(4).html());
$('#txtF').val($(tds).eq(5).html());
$('#txtG').val($(tds).eq(6).html());
$('#txtH').val($(tds).eq(7).html());
$('#txtI').val($(tds).eq(8).html());
$('#txtJ').val($(tds).eq(9).html());
$('#txtK').val($(tds).eq(10).html());
});
});
</script>
</head>
<body>
<table class="table table-striped" id="example" width="100%">
<tr>
<td>
<input type="text" id="txtA"><br />
<input type="text" id="txtB"><br />
<input type="text" id="txtC"><br />
<input type="text" id="txtD">
</td>
<td>
<input type="text" id="txtE">
<input type="text" id="txtF"><br />
<input type="text" id="txtG"><br />
<input type="text" id="txtH">
</td>
<td>
<input type="text" id="txtI"><br />
<input type="text" id="txtJ"><br />
<input type="text" id="txtK">
</td>
</tr>
</table>
<hr />
<table id="tblChopNo" class="table table-striped" width="100%">
<thead>
<tr class="success">
<th>A</th>
<th>B</th>
<th>C</th>
<th>D</th>
<th>E</th>
<th>F</th>
<th>G</th>
<th>H</th>
<th>I</th>
<th>J</th>
<th>K</th>
</tr>
</thead>
<tbody>
@foreach (var item in ViewBag.chopNo)
{
<tr>
<td>@item.A</td>
<td>@item.B</td>
<td>@item.C</td>
<td>@item.D</td>
<td>@item.E</td>
<td>@item.F</td>
<td>@item.G</td>
<td>@item.H</td>
<td>@item.I</td>
<td>@item.J</td>
<td>@item.K</td>
</tr>
}
</tbody>
</table>
</body>
</html>
Screenshot