Hi,
I've read the previous threads on this topic but I still cannot seem to get it working consistently.
I have a radgrid that contains an Image button column. I am registering the button in this column as a post back control in the ItemCreated event of the grid. When the page first loads and I click on this button it works as expected, by doing a full postback. The problem only occurs if any other ajax update is applied to the grid, such as selecting a different page off the grid. The next time i click on the 'post back' button in the column, it will postback via ajax.
Here is my code:
This is the column definition in the rad grid:
Thanks for your help
I've read the previous threads on this topic but I still cannot seem to get it working consistently.
I have a radgrid that contains an Image button column. I am registering the button in this column as a post back control in the ItemCreated event of the grid. When the page first loads and I click on this button it works as expected, by doing a full postback. The problem only occurs if any other ajax update is applied to the grid, such as selecting a different page off the grid. The next time i click on the 'post back' button in the column, it will postback via ajax.
Here is my code:
void
SearchResults_ItemCreated(
object
sender, GridItemEventArgs e)
{
if
(e.Item
is
GridDataItem)
{
GridDataItem item = e.Item
as
GridDataItem;
ImageButton publishedImgButton = item[
"PublishButton"
].Controls[0]
as
ImageButton;
if
(publishedImgButton !=
null
)
{
RadScriptManager.GetCurrent(
this
.Page).RegisterPostBackControl(publishedImgButton);
}
}
}
This is the column definition in the rad grid:
<
telerik:GridButtonColumn
ItemStyle-HorizontalAlign
=
"Center"
HeaderText
=
"Download PDF file"
UniqueName
=
"PublishButton"
CommandName
=
"GetPublished"
ButtonType
=
"ImageButton"
ImageUrl
=
"../../Images/Buttons/Small/document_down.png"
>
<
ItemStyle
HorizontalAlign
=
"Center"
></
ItemStyle
>
</
telerik:GridButtonColumn
>
Thanks for your help