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

ConfirmText with autogenerated Delete button?

1 Answer 123 Views
Grid
This is a migrated thread and some comments may be shown as answers.
scrut
Top achievements
Rank 1
scrut asked on 05 Jul 2008, 07:07 PM
I have several Grids with

AutoGenerateDeleteColumn="True" 

But I want to make sure that if the user clicks this button, a confirmation dialog pops up. With regular Columns I can use the ConfirmText tag - but how do I do the same with autogenerated delete buttons?

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 07 Jul 2008, 05:28 AM
Hi Scrut,

Try out the following code snippet to set the ConfirmText property for the AutoGenerateDeleteColumn.

CS:
protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridColumn) 
        { 
            GridColumn col = (GridColumn)e.Column; 
            if ((col.ColumnType=="GridButtonColumn")&&(col.UniqueName == "AutoGeneratedDeleteColumn")) 
            { 
                GridButtonColumn btncol = (GridButtonColumn)e.Column; 
                btncol.ConfirmText = "Are you sure you want to delete this item";                 
            } 
        }           
    } 


Thanks
Princy.
Tags
Grid
Asked by
scrut
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or