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

[Solved] RegisterPostbackControl

1 Answer 391 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Curt
Top achievements
Rank 1
Curt asked on 17 Apr 2008, 01:53 AM
I have just updated my prometheus controls to the newly released version.  Previously I had a grid that had buttons in its footer to allow exports.  I had to do the following to get the buttons to get outside the "Ajax Panel" to cause a full postback:

protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
        { 
            if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
            { 
                GridEditFormItem item = (GridEditFormItem)e.Item; 
                RadEditor editor1 = (RadEditor)item["Notes"].Controls[0]; 
                try 
                { 
                    (e.Item.FindControl("UpdateButton"as ImageButton).Attributes.Add("onclick""saveEditorContent('" + editor1.ClientID + "');"); 
                } 
                catch 
                { 
                    (e.Item.FindControl("PerformInsertButton"as ImageButton).Attributes.Add("onclick""saveEditorContent('" + editor1.ClientID + "');"); 
                } 
            } 
            if (e.Item is GridFooterItem) 
            { 
                ImageButton btnExcel = (e.Item as GridFooterItem).FindControl("btnExcel"as ImageButton; 
                ImageButton btnWord = (e.Item as GridFooterItem).FindControl("btnWord"as ImageButton; 
 
                ScriptManager sc = ScriptManager.GetCurrent(Page); 
                sc.RegisterPostBackControl(btnExcel); 
                sc.RegisterPostBackControl(btnWord); 
 
            } 
            if (e.Item is GridDataItem) 
            { 
                ImageButton showProfile = (e.Item as GridDataItem).FindControl("showItem"as ImageButton; 
 
                ScriptManager sc = ScriptManager.GetCurrent(Page); 
                sc.RegisterPostBackControl(showProfile); 
            } 
        } 

This worked fine but with the newest build I find that it no longer works.  Is there something else I should be doing?

Thanks


1 Answer, 1 is accepted

Sort by
0
Curt
Top achievements
Rank 1
answered on 17 Apr 2008, 03:40 PM
Found the problem I think.  I had removed the line calling the ItemCreated method while doing some other testing.  I put the line back in and it works.  I had switched back to an older version of the prometheus dll while trying to figure this out.  Hopefully it will still work when I move to the newest version.

-Feeling a bit sheepish.
Tags
Grid
Asked by
Curt
Top achievements
Rank 1
Answers by
Curt
Top achievements
Rank 1
Share this question
or