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
close icon

Problem with retrieving the Push Button Description

I am using a gridbounddata grid with some grid bound columns. Two of the columns are push buttons where I set the properties and the description of the buttons. I am subscribed to the pushbutton click event and the prepare view style event. When I click a button I have the text changed lets say from "a" to "b" for that row only using the prepare view style event. When I click on the button again and I check the description it is still the original text and not the new text. How can I check this? I can attach a cs file if needed.

Thanks

4 Replies

HA haneefm Syncfusion Team June 13, 2007 08:04 PM UTC

Hi John,

You can handle the Model.QueryCellInfo event of the griddataboundgrid and set the e.Style.Description as data that you want it to be displayed for the pushbutton cells in grid. Please refer the attached sample for implementation.

Here is a sample that show you "How to change push button text on click?".
PushButton_DataGrid.zip

Best regards,
Haneef


JO John June 14, 2007 02:17 PM UTC

Thanks that worked. I just moved everything I had in the prepareviewstyle event into that one and I was retrieving the correct button text depending on the row and what was clicked.

Thanks

>Hi John,

You can handle the Model.QueryCellInfo event of the griddataboundgrid and set the e.Style.Description as data that you want it to be displayed for the pushbutton cells in grid. Please refer the attached sample for implementation.

Here is a sample that show you "How to change push button text on click?".
PushButton_DataGrid.zip

Best regards,
Haneef


JO John June 15, 2007 06:31 PM UTC

I have one more weird problem I am enabled just two cells within the grid after the user clicks on the button. These cells become editable and when the user leaves cell one it commits the changes to the row. I would like to have the changes not commit until the user hits the cell push button again. Is this possible?

thanks again

>Thanks that worked. I just moved everything I had in the prepareviewstyle event into that one and I was retrieving the correct button text depending on the row and what was clicked.

Thanks

>Hi John,

You can handle the Model.QueryCellInfo event of the griddataboundgrid and set the e.Style.Description as data that you want it to be displayed for the pushbutton cells in grid. Please refer the attached sample for implementation.

Here is a sample that show you "How to change push button text on click?".
PushButton_DataGrid.zip

Best regards,
Haneef


HA haneefm Syncfusion Team June 15, 2007 08:40 PM UTC

Hi John,

By Default,The databound grid will push all data for a row into the underlying datasource for every record once you move the current cell of that record. Once the changes for a record have been pushed into the datasource the grid has no more knowledge about these changes and thus cannot reverse and undo these changes.It does not push all data for a row into the underlying datasource for every cell movement.If you want to push all data to undelying datasource for every cell movement,you need to call in Binder.EndEdit Method(before calling this , you need to call the CurrentCell''s Edit method). Here is a code snippet

[c#]
this.gridDataBoundGrid1.CurrentCell.EndEdit();
this.gridDataBoundGrid1.Binder.EnableEdit();

If you want to deattach the datasource from the grid then set BindToCurrencyManager property to false;

[c#]
this.gridDataBoundGrid1.Binder.BindToCurrencyManager = false;

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon