Windows Develop Bookmark and Share   
 index > Windows Forms Data Controls and Databinding > How to add?
 

How to add?

I am working with a result reporting windows form that is displaying marks of each students, i am assigned to create a custom collumn that will display if mark is in a row is < 75 then fail else pass. I am extracting all records except this pass/fail column from SQL database.

So, How can i add this function means, displaying pass/fail in autogenereated collumns with each rows of datagridview by validation of that rows mark collumn (if value < 75 then print 'fail' in that autogenerated collumn front of particular row).


-Thanks in advanced!!!


NIIT HOUSE GKP INDIA Please mark the replies as answers if they help and unmark if they don't.
Nitin Chaudhary  Friday, July 31, 2009 7:31 PM
Add column which display fail/pass, and in CellFormating event set the value as Fail or Pass.
refer,
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx
NareshG  Friday, July 31, 2009 8:04 PM
Select col1, col2,..., Status='pass' from table where marks >75
union
select col1, col2,...., Status='fail' from table where marks <75

here Status column will be generated at runtime.
guptashail  Tuesday, August 04, 2009 10:13 PM
Add column which display fail/pass, and in CellFormating event set the value as Fail or Pass.
refer,
http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.cellformatting.aspx
NareshG  Friday, July 31, 2009 8:04 PM
any other ideas?
NIIT HOUSE GKP INDIA Please mark the replies as answers if they help and unmark if they don't.
Nitin Chaudhary  Tuesday, August 04, 2009 4:36 PM
One more thing you can do is modifiey your query which fetch database, In SQL you can use case-when.
NareshG  Tuesday, August 04, 2009 7:19 PM
Select col1, col2,..., Status='pass' from table where marks >75
union
select col1, col2,...., Status='fail' from table where marks <75

here Status column will be generated at runtime.
guptashail  Tuesday, August 04, 2009 10:13 PM

You can use google to search for other answers

Custom Search

More Threads

• can i make the datasource and display member Properties for my control
• Datagridview drag & drop but still allow right click
• Reg binding a image from a Database to combobox
• IDataGridViewEditingControl
• BUG in data grid control
• DataGridViewComboBoxColumn with datasource binds to generic list
• Databinding and Control-Events
• listview dataview
• Problem with calling web-service (WCF) through WinForms...
• Datagridview uses combo box