Hi
I have below code & id record is want i want to highlight Book column of that row in a table
C#
View_SessionDeliveryParticipant_Detailed Result = bALSessionDeliveryParticipant.GetSessionDeliveryParticipantBookHistory(Convert.ToInt32(ddlBook.SelectedItem.Value), StudentCollection);
if (Result != null)
{
//Highlight column student of that row in a table
}SQL
Book
Session
Segment
Session Date
Session Start Time
Session End Time
Mentor
Student
Session Status
Action
Zero Attendance--%>Thanks

Mohamed Azarudeen ZRank #297 · 8.5K reputationPosted Jun 6, 2023, 5:53 AM EDT
Hi ramco here is the modified code
View_SessionDeliveryParticipant_Detailed Result = bALSessionDeliveryParticipant.GetSessionDeliveryParticipantBookHistory(Convert.ToInt32(ddlBook.SelectedItem.Value), StudentCollection); if (Result != null) { int idToHighlight = 123; // Replace with the ID you want to highlight foreach (var item in Result) { // Check if the current item matches the ID to highlight if (item.Id == idToHighlight) { // Add a CSS class to the specific column of the row PlaceHolderTable.Controls.Add(new LiteralControl("")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Book + "")); // Highlight Book column PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Session + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Segment + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionDate + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionStartTime + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionEndTime + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Mentor + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Student + "")); // Highlight Student column PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionStatus + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Action + "")); PlaceHolderTable.Controls.Add(new LiteralControl("")); } else { // Add the row without highlighting PlaceHolderTable.Controls.Add(new LiteralControl("")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Book + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Session + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Segment + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionDate + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionStartTime + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionEndTime + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Mentor + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Student + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.SessionStatus + "")); PlaceHolderTable.Controls.Add(new LiteralControl("" + item.Action + "")); PlaceHolderTable.Controls.Add(new LiteralControl("")); } } }.highlight { background-color: yellow; // Customize the highlighting style as needed }Ramco RamcoRank #462 · 5.4K reputationPosted Jun 6, 2023, 5:58 AM EDT
Hi Mohammed
Table has already been displayed. Now user inputs some value then i have to find that id in a row & highlight the table
Thanls