I used radgrid view for display some of my data and using that rad view. I need to do two things
1. delete some records - need ajax manager
2. stream to web browser - need to disable ajax manager.
here is my code snipts
<script type="text/javascript">
function requestStart(sender, args) {
if (args.get_eventTarget().indexOf("GD") > 0)
args.set_enableAjax(false);
}
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="requestStart">
in the grid
in the code behind
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "G")
{
genDoc(e.Item.ItemIndex);
}
}
protected void ImageButton1_Click(object sender, EventArgs e) //method 2
{
genDoc(0);
}
If I use the commented link button thing it will go to the method run method well but not give me download a file.
If I use image button it works well and I can download a file, but I cant get particular index to my method(e.Item.ItemIndex
)...{in the genDoc() - document.Save("Sample.doc", FormatType.Doc, Response, HttpContentDisposition.Attachment); }
any way what I want to pass e.Item.ItemIndex value to my method genDoc(int index)...Please help me. thanks
1. delete some records - need ajax manager
2. stream to web browser - need to disable ajax manager.
here is my code snipts
<script type="text/javascript">
function requestStart(sender, args) {
if (args.get_eventTarget().indexOf("GD") > 0)
args.set_enableAjax(false);
}
</script>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="requestStart">
in the grid
<%--<telerik:GridButtonColumn ButtonType="LinkButton" Text="<img src='../App_Themes/default/images/genDoc.gif' border='0' title='Generate Document'/>" UniqueName="GD" CommandName="G"></telerik:GridButtonColumn>--%><telerik:GridTemplateColumn HeaderText="" UniqueName="Image"><ItemTemplate>
<asp:ImageButton ID="GD" runat="server" ImageUrl="~/App_Themes/Default/images/genDoc.gif" CommandName="1" OnClick="ImageButton1_Click">
</asp:ImageButton>
</ItemTemplate><br></telerik:GridTemplateColumn>in the code behind
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
{
if (e.CommandName == "G")
{
genDoc(e.Item.ItemIndex);
}
}
protected void ImageButton1_Click(object sender, EventArgs e) //method 2
{
genDoc(0);
}
If I use the commented link button thing it will go to the method run method well but not give me download a file.
If I use image button it works well and I can download a file, but I cant get particular index to my method(e.Item.ItemIndex
)...{in the genDoc() - document.Save("Sample.doc", FormatType.Doc, Response, HttpContentDisposition.Attachment); }
any way what I want to pass e.Item.ItemIndex value to my method genDoc(int index)...Please help me. thanks