Hi
I have below code in code behind. I want when user clicks on Group Name row data should get filled in Table footer columns
StudentDetail Res = bALStudents.GetStudentDetail(Convert.ToInt32(colum.StudentID));
lblGroup.Text = colum.Group.GroupName;
htmlTable.Append("");
htmlTable.Append("");
htmlTable.Append("" + Count.ToString() + " ");
htmlTable.Append("" + colum.Group.GroupName + " ");
htmlTable.Append("" + Res.Name + " ");
htmlTable.Append("" + "" + " ");
htmlTable.Append("" + "" + " ");
-
Select Student
Add
Thanks
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Naimish MakwanaPosted Apr 16, 2023, 4:32 AM
Based on the provided code, it looks like you are creating a dynamic HTML table with student details and a footer row containing form controls to add new records.
To fill the footer columns with data when a user clicks on a group name row, you can add a JavaScript function that will handle the click event and populate the form controls with the selected group's data.
Here's an example of how you can achieve this:
1. Add an "onclick" attribute to the group name cell in the table row:
2. Define the "fillFooterColumns" function in a script tag within the HTML file:
3. Update the server-side "lnkAddRecord_Click" event handler to retrieve the selected values from the footer controls and add a new record to the database.
Note: You will need to implement the TODO comment in step 2 to retrieve the students in the selected group using AJAX or a postback.
Thanks
Naimish Makwana