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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

adding celltype during runtime...

Thread ID:

Created:

Updated:

Platform:

Replies:

17344 Aug 6,2004 06:08 AM UTC Aug 12,2004 03:30 AM UTC Windows Forms 4
loading
Tags: GridControl
zh
Asked On August 6, 2004 06:08 AM UTC

Hi all, I have created griddatabound to bind the dataset. there are columns created in PrepareViewStyleInfo event. tt column added is of celltype checkbox. so when i trigger the checkbox event, i will need to add pushbutton. however this pushbutton just can''t display out. is it i can''t add pushbutton during runtime? or in a event?

Administrator [Syncfusion]
Replied On August 6, 2004 06:33 AM UTC

You cannot set a style property (other than CellValue (or Text which is essentially the same property as CellValue)) on an individaul cell in a GridDataBoundGrid. When you say you are setting a pushbutton in your checkbox click event, is this what you mean? If so, you cannot just set gridDataBoundGrid[row, col].CellType = "PushButton". Instead, what you can do is to handle the grid.Model.QueryCellInfo event. There if e.RowIndex > 0 and e.ColinDex points to the column where you want to maybe set the pushbutton, you should check the value of grid[e.RowIndex, checkBoxColumnIndex].CellValue to see if it is true. If so, then set e.Style.CellType = "PushButton". Here is a little sample that changes a cell to a pushbutton when a checkbox in another cell is checked. It uses QueryCellInfo as described above, and also uses CurrentCellChanged to make sure the pushbutton cell gets redrawn when teh checkbox changes. PushButtonOnCheck_2126.zip

zh
Replied On August 11, 2004 12:47 AM UTC

thank you so much. however, it is possible to show me in .vb version? i coding in vb.net. and somehow i could not find the querycellinfo event... sorry to trouble you... thank you...

Administrator [Syncfusion]
Replied On August 11, 2004 06:34 AM UTC

QueryCellInfo is a member of gridDataBoundGrid.Model. Here is a VB version of the previous sample. PushButtonOnCheck_1999.zip

zh
Replied On August 12, 2004 03:30 AM UTC

thank you so much... hope this time it can work...

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;