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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

on TableControlPushButtonClick pushbutton text change or disable

Thread ID:

Created:

Updated:

Platform:

Replies:

131281 Jul 1,2017 10:07 AM UTC Jul 3,2017 12:00 PM UTC WinForms 1
loading
Tags: GridGroupingControl
ketan
Asked On July 1, 2017 10:07 AM UTC


hello sir/madam
i am using SyncfusionGridGroupingControl and inside one push button.
i want to change pushbutton text on TableControlPushButtonClick using c# code,so please help me how can i do

thank u in advance.

Arulpriya Ramalingam [Syncfusion]
Replied On July 3, 2017 12:00 PM UTC

Hi ketan, 

Thank you for using Syncfusion products. 

In order to change the Button Text when the button is clicked, the QueryCellStyleInfo and TableControlPushButtonClick events can be used. In QueryCellStyleInfo event the Description property can be used to set the PushButtonText. Please make use of below code and sample, 

//Event Triggering 
gridGroupingControl1.QueryCellStyleInfo += GridGroupingControl1_QueryCellStyleInfo; 

//Event Customization 
private void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) 
{ 
    if(e.TableCellIdentity != null && e.TableCellIdentity.Column != null && e.TableCellIdentity.Column.MappingName == "Button") 
    { 
        string key = e.TableCellIdentity.RowIndex.ToString() + e.TableCellIdentity.ColIndex.ToString(); 
        if (description.Count > 0 && description.ContainsKey(key)) 
        { 
            string value = description[key]; 
            if (description.Count > 0 && !String.IsNullOrEmpty(value)) 
            { 
                e.Style.Description = value; 
            } 
        } 
    } 
} 
//Event Triggering 
gridGroupingControl1.TableControlPushButtonClick += GridGroupingControl1_TableControlPushButtonClick; 
 
//Event Customization 
private void GridGroupingControl1_TableControlPushButtonClick(object sender, GridTableControlCellPushButtonClickEventArgs e) 
{ 
    rowIndex = e.Inner.RowIndex; 
    colIndex = e.Inner.ColIndex; 
    string key = rowIndex.ToString() + colIndex.ToString(); 
    if (!description.ContainsKey(key)) 
    { 
        description.Add(key, "Start"); 
    } 
    else 
    { 
        string value = description[key]; 
        if (value == "Start") 
            description[key] = "Stop"; 
        else 
            description[key] = "Start"; 
    } 
} 

 
Note: 
The TableControlCellButtonClicked event can also be used instead of TableControlPushButtonClick event. 


Regards, 
Arulpriya 


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

;