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

Adding pushbutton to grid bound to datatable

Thread ID:





17274 Aug 4,2004 09:41 PM UTC Aug 4,2004 09:58 PM UTC WinForms 1
Tags: GridControl
Damien Sawyer
Asked On August 4, 2004 09:41 PM UTC

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 09:58 PM UTC

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon