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

GridButtonColumn does not show changes from CodeBehind on first load

3 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
rugydp
Top achievements
Rank 1
rugydp asked on 23 Sep 2016, 02:37 PM

Hello

I have a complex grid with a GridButtonColumn where I want to set some parameters in codebehind. I'm using RadGrid1_PreRender for this.

Strangely, it only works after I used the pager to change page and not on first load... 

What am I missing here? I also Page_Load, Page_PreRender, OnColumnCreated, still it just never works on first load and it's driving me insane :/

Thanks!!

protected void GridMaster_PreRender(object sender, EventArgs e)
        {         
                foreach (GridColumn col in GridMaster.MasterTableView.Columns)
                {
                    if (col.UniqueName == "DeleteEntryCommand")
                    {
                        var deleteColum = col as GridButtonColumn;
                        // deleteColum.ConfirmText = RessourceHelper.GetRessource(name: "KontraktLoeschenBestaetigen", kurzText: false, textIfEmpty: "Soll der Kontrakt wirklich gelöscht werden?", languageId: null);
                        deleteColum.ConfirmTitle = RessourceHelper.GetRessource(name: "KontraktLoeschenBestaetigenTitel", kurzText: false, textIfEmpty: "Kontrakt löschen", languageId: null);
                        deleteColum.ConfirmTextFormatString = RessourceHelper.GetRessource(name: "KontraktLoeschenBestaetigen", kurzText: false, textIfEmpty: "Soll der Kontrakt {0} wirklich gelöscht werden?", languageId: null);
                        deleteColum.ConfirmTextFields = new string[] { "Referenz" };
                    }
                }
        }

 

<telerik:GridButtonColumn
 UniqueName="DeleteEntryCommand"
 CommandName="Delete"
 ConfirmDialogType="RadWindow"
 ConfirmDialogWidth="300"
 ConfirmDialogHeight="150"
 Text=""
 ItemStyle-HorizontalAlign="Center"
 ItemStyle-CssClass="radGridDeleteColumn"
 ButtonCssClass="fa fa-trash-o fa-1x radGridDeleteButton">
 <HeaderStyle Width="40" />
</telerik:GridButtonColumn>

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 28 Sep 2016, 11:15 AM
Hello,

I tested the behavior and it is working as expected on my end when the GridButtonColumn settings are changed in the Page_Load event. I am attaching a sample project I used for testing. Give it a try and see how it works for you.

Regards,
Viktor Tachev
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
rugydp
Top achievements
Rank 1
answered on 13 Oct 2016, 01:22 PM

Hello Viktor

Thank you for your answer. But I was assigned to another project for the last weeks and couldn't look in to the issue. Now the link you provided is dead.

Is it possible to provide it again? (Sorry about that...)

I looked into issue again, now on another project with GridButtonColumn but this time in DetailTables. Same effect: button values change after first postback, but not on first page load... There must be some thing I to fundamentally wrong....

0
Eyup
Telerik team
answered on 18 Oct 2016, 07:25 AM
Hello,

We were experiencing a technical issue with these archive files, however, I'm pleased to say that our responsive technical experts have already fixed the problem.

Please excuse us for the inconvenience this might have caused you.


Regards,
Eyup
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
rugydp
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
rugydp
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or