Embedding non-edit widgets in a DataGridView


Is there any way to embed a widget in a data-bound DataGridViewCell when it is not in editing mode?

For example, we are wanting to display an existing calendar widget in a cell. That cell contains a comma separated list of dates. We want to show the calendar instead of the text.

We could create a custom cell and override the Draw method so that it draws the calendar in the cell, but that would not handle the mouse-over tool-tip that we already have in the existing calendar widget.

[Update] I tried TcKs's suggestion, but was not able to create a working solution. See the comments on that answer.


You should derive your own type from DataGridViewColumn (e.g. a DataGridViewCalendarColumn) and return a DataGridViewCalendarCell (that you have to create yourself, too) as the CellTemplate.
A detailed description can be found in the MSDN article Build a Custom RadioButton Cell and Column for the DataGridView Control

By : EFrank

You can instead of drawing calendar, take a calendar control, set them the grid as parent and set them same bounds ( left, top, width, height ) as cell has.

By : TcKs

Look in Books on-line for Raiserror (Described)

You will find the syntax looks like this:

RAISERROR ( { msg_id | msg_str } { , severity , state } 
    [ , argument [ ,...n ] ] ) 
    [ WITH option [ ,...n ] ]

and the error arguments are as follows:

d or I Signed integer 
o Unsigned octal 
p Pointer 
s String 
u Unsigned integer 
x or X Unsigned hexadecimal

Any language from VB onwards has the ability to catch these and let you to take the appropriate action.

Dave J

This video can help you solving your question :)
By: admin