how to add costom derived attribute (collumn) to a datagidview

mkkb917

Member
Joined
Nov 24, 2012
Messages
18
Location
Pakistan
Programming Experience
Beginner
hi
me new in this forum and got a problem
plz tell me how can i add a custom column that is derived form the other two columns of the datagrid view
in my datagtidview ther are 4 columns named" User ID, Tate, Time in, Time out" and now i want to add a column named "Duration" which will display the total time period of user that stay sign in on the software
kindly help me in this
thanks
 
I think that your terminology is a bit confused. When we talk about a "custom column" in a DataGridView that generally means one that displays and edits data differently to the standard column types. The standard column types available will display text boxes, combo boxes, check boxes, buttons, hyperlinks and images. If you want to display something different, e.g. date/time pickers, then you need to create a custom column type, which means a custom cell type and editing control type too. Once you've created those classes, using your new column type is exactly like using any other column type.

I think what you're actually asking for is an unbound column. Are the first four columns you mention (User ID, Tate, Time in, Time out) coming from a database and you want to add a fifth column to your grid that doesn't represent data that's actually stored but rather calculated dynamically?
 
yes bro
i am asking for an unbound column. and that will be a calculated dynamically from the two columns coming from the database
and by using database terminalogy it is a derived attribute just like age which can be calculated from the DOB (Date Of Birth).
you got my point in last two lines you wrote
now here using the gridview how can i implement it
 
Back
Top