Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I m working on the online exam project.I have one form on which i show one question and its four options on four radio buttons i want that when user slect any option and click on next button that question and its selected option must shown in the datagrid view in green colour and the status coloumn show attempt but if student dont choose any option n click on the next button that question must be hown in the datagridview in red colour and status column must contain the value not attempt...
when user thinks that he knows the ans of that question which he didnot attempt then he choose that question from data grid view and the question with four options must be shown on the form and student choose one option and when he click on next button that question with option must be shown in database means updated in green colour and status also changed to attempt. and next red marked question must be selected from datagridview automaticlly..
plzz give code for this.. urgently..
Thank you..!
Posted

1 solution

Hi, you can set DefaultCellStyle.BackColor or DefaultCellStyle.ForeColor Property for Selected Row.
C#
DataGridViewRow dtGridRow = DataGridView1.Rows(SelectedRowIndex);
dtGridRow.DefaultCellStyle.BackColor = Color.Green;

I hope this will help you. :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900