This is a migrated thread and some comments may be shown as answers.

CommandCell Click

2 Answers 99 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Troy Clemons
Top achievements
Rank 1
Troy Clemons asked on 24 Feb 2016, 07:16 PM

is there a way to Change the Default Text in the commandcell upon click

 

thanks in advance

2 Answers, 1 is accepted

Sort by
0
Accepted
Ralitsa
Telerik team
answered on 26 Feb 2016, 10:34 AM
Hello Troy,

Thank you for contacting us. 

The default text should be used when all cells have equal text and you can not change it. I can suggest you to set the UseDefaultText property to false. Then set the Value property of all command cells with code: 
for (int i = 0; i < this.radGridView1.Rows.Count; i++)
{
    this.radGridView1.Rows[i].Cells["CommandColumn"].Value = "test";
}

Then you can change the Value of command cell in in the CommandCellClick event. Please refer to the code snippet below: 
void radGridView1_CommandCellClick(object sender, GridViewCellEventArgs e)
{
    e.Row.Cells["CommandColumn"].Value = "Click " + DateTime.Now.Millisecond;
}

I hope this information is useful. Should you have further questions please do not hesitate to write back.

Regards,
Ralitsa
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Troy Clemons
Top achievements
Rank 1
answered on 26 Feb 2016, 01:09 PM
Works like a charm. Thank you
Tags
GridView
Asked by
Troy Clemons
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
Troy Clemons
Top achievements
Rank 1
Share this question
or