Hey guys, i have been coding a radgrid with the option to export the data as excel and word. That all works just fine also the export, but when i change visible true/false the export buttons suddenly will not trigger as the first time.
I have these export buttons inside a radpagelayout. The 3'rd button "btnAddP" has visibility change, so when i click it it will hide the export buttons. When the visibility is back to export buttons, they don't do anything when clicked. I wanted to hear some suggestions from you guys and maybe if someone have had the same issue and how to handle it properly.
01.
<Columns>
02.
<telerik:LayoutColumn Span=
"8"
>
03.
<telerik:RadPageLayout ID=
"rplRadgrid"
runat=
"server"
>
04.
<telerik:LayoutRow>
05.
<Columns>
06.
<telerik:LayoutColumn Span=
"4"
>
07.
<telerik:RadButton ID=
"ibtnExportAsExcel"
runat=
"server"
ToolTip=
"Excel"
OnClick=
"ibtnExportAsExcel_Click"
CssClass=
"Margin"
>
08.
<Image ImageUrl=
"~/Images/filetype-tiny.xls.png"
/>
09.
</telerik:RadButton>
10.
<telerik:RadButton ID=
"ibtnExportAsWord"
runat=
"server"
ToolTip=
"Word"
OnClick=
"ibtnExportAsWord_Click"
11.
<Image ImageUrl=
"~/Images/filetype-tiny.doc.png"
/>
12.
</telerik:RadButton>
13.
<telerik:RadButton ID=
"btnAddP"
runat=
"server"
OnClick=
"btnAddParticipants_Click"
14.
<Image ImageUrl=
"../Images/edit-tiny.png"
/>
15.
</telerik:RadButton>
16.
</telerik:LayoutColumn>
17.
</Columns>
18.
</telerik:LayoutRow>
......
void
ConfigureExport()
{
radgrid.ExportSettings.UseItemStyles =
radgrid.ExportSettings.ExportOnlyData =
radgrid.ExportSettings.IgnorePaging =
radgrid.ExportSettings.OpenInNewWindow =
true
;
radgrid.ExportSettings.FileName = Resources.c3.Export;
}
protected
void
ibtnExportAsExcel_Click(
object
sender, EventArgs e)
{
ConfigureExport();
radgrid.MasterTableView.ExportToExcel();
}
protected
void
ibtnExportAsWord_Click(
object
sender, EventArgs e)
{
ConfigureExport();
radgrid.MasterTableView.ExportToWord();
}
protected
void
btnAddP_Click(
object
sender, EventArgs e)
{
tmrChatBoard.Enabled =
false
;
rplUpdateP.Visible =
true
;
rplRadgrid.Visible =
false
;
}