We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Dynamically change row type

I need to create a two column grid. The first column will contain the field name, the second column will contain the data. Is it possible to set a different data type for different rows in the same column or would I have to make them all strings?

Thanks in advance.

3 Replies

AD Administrator Syncfusion Team August 9, 2006 06:42 AM UTC

Hi Jay,

To achieve this, you need to handle the QueryCellInfo event and set the CellValueType property of the cell (e.Style.CellValueType = typeof(int) ). Here is a minimal sample to implement this.

Thanks,
Srividhya R

RowType.zip


JA Jay August 9, 2006 07:54 AM UTC

Hi,

So this means just before the user selects the second column to edit it''s value, setting the cellvalue in QueryCellInfo will change a textbox column to a monthcalender or dropdown, and they will function correctly?

Thx


AD Administrator Syncfusion Team August 9, 2006 09:42 AM UTC

Hi Jay,

The QueryCellInfo event is normally used to provide the GridStyleInfo object for a given cell. If the underlying datasource accepts, then ofcourse you can change the CellValueType and CellValues by handling this event. To know more about QueryCellInfo, you can take a look at
this documentation:

http://www2.syncfusion.com/library/gridwindows/querycellinfoevent.html

Let us know if you have any further queries.

Thanks,
Srividhya R

Loader.
Live Chat Icon For mobile
Up arrow icon