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.

Adding pushbutton to grid bound to datatable

Thread ID:

Created:

Updated:

Platform:

Replies:

17274 Aug 4,2004 05:41 PM Aug 4,2004 05:58 PM Windows Forms 1
loading
Tags: GridControl
Damien Sawyer
Asked On August 4, 2004 05:41 PM

Hi, I''m having trouble with something I would have thought quite simple. I''m sure the answer is right in front of my nose. I am binding a grid to a datatable. However, I also need to add a push button to each row (in the first column). I can''t seem to get ''both'' happening simultaneously. One seems to clear the other. Can someone please point me in the right direction? Thanks in advance, DS

Administrator [Syncfusion]
Replied On August 4, 2004 05:58 PM

If by first column you mean the first column from your datatable (and not the row header column), then setting the CellType = "PushButton" does not display the CellValue property. A pushButton cell gets its display text from the style.Description. So, that is probably why you are seeing a push button with no text if that is in fact what you are seeing. One way you can try to handle this is to subscribe to the PrepareviewStyleInfo event. In the handler try code similar to
if(e.RowIndex > 0 && e.ColIndex == 1)
{
	e.Style.CellType = "PushButton";
	e.Style.Description = e.Style.Text;
}
This should display the pushbutton and use teh style.Text property for the Description. If it does not work form PrepareViewStyleInfo, try it from grid.Model.QueryCellInfo.

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.

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.

;