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

Grid Q1 2009 - How to access the text of ConfirmText and ConfirmTitle for a GridButtonColumn

2 Answers 47 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hans van Rijnswoud
Top achievements
Rank 2
Hans van Rijnswoud asked on 31 Jul 2009, 06:51 AM
HI,

We make a multilanguage support application with the telerik component.

To change the text of the header or other things in the grid we use OnItemDataBound and it's works Fine.
The only things is i can't found a way to change the text of a GridButtonColumn for ConfirmText and ConfirmTitle.

Can i access to this if e.item is GridDataItem ?

like:

if(e.Item is GridDataItem)
{
    var _item = e.Item as GridDataItem;
    _item["UniqueName"].ConfirmText = GetText.Get("VariableString");
   _item["UniqueName"].ConfirmTitle = GetText.Get("VariableString");
}

For GridHeaderItem and GridNoRecordsItem is no problem.

Thanks for your help.

Edwin.

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 31 Jul 2009, 07:14 AM
Hello Edwin,

Since ConfirmText and ConfirmTitle are column properties, you have to acess the column and set the properties for the column as shown below:

c#:
 protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) 
    {   
           foreach (GridColumn col in RadGrid1.MasterTableView.RenderColumns) 
            { 
                if (col.UniqueName == "UniqueName"
                { 
                    (col as GridButtonColumn).ConfirmText = "Custom Confirm Text"
                    (col as GridButtonColumn).ConfirmTitle = "Custom Confirm Title"
                } 
            } 
    }        

Thanks
Princy.
0
Hans van Rijnswoud
Top achievements
Rank 2
answered on 31 Jul 2009, 08:17 AM
Hi Princy,

Thanks for this quick answer.
Regards,

Edwin.
Tags
Grid
Asked by
Hans van Rijnswoud
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 1
Hans van Rijnswoud
Top achievements
Rank 2
Share this question
or