Rank: Newbie Groups: Member
Joined: 9/30/2014 Posts: 1
|
Hi. I put ProgressBar in UpdatePanel. Progress works well. But on finish of work OnRunTask I want to bind data to gridview. Code works, but data on gridview doesn't change.
P.S. Sorry for bad English.
<%@ Page Title="....." Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Profile_Profile" enableEventValidation="false" Async="true" %> <%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
......
<asp:UpdatePanel ID="UpdatePanel3" runat="server"> <ContentTemplate> ...... <asp:MultiView ID="MultiView1" runat="server"> ...... <asp:View ID="View3" runat="server"> <p> <asp:Button ID="Button2" runat="server" Text="... "/>
<eo:ProgressBar ClientIDMode="Static" runat="server" id="ProgressBar1" ShowPercentage="True" IndicatorImage="00060104" BackgroundImageRight="00060103" ControlSkinID="None" BackgroundImage="00060101" IndicatorIncrement="7" BackgroundImageLeft="00060102" Width="300px" StartTaskButton="Button2" OnRunTask="ProgressBar1_RunTask" > </eo:ProgressBar>
<ajax:Accordion ID="log_panel" runat="server" SelectedIndex="-1" AutoSize="None" FadeTransitions="false" RequireOpenedPane="false" Width="887px"> <Panes> <ajax:AccordionPane runat="server" ID="Logs"> <Header>...</Header> <Content> <asp:Button ID="Button3" runat="server" Text="..."/> <asp:Button ID="Button4" runat="server" Text="..."/>
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" OnSorting="gv_users_Sorting" GridLines="none" AllowSorting="true" AutoGenerateColumns="False" PageSize="30" Width="100%" ShowFooter="True" OnPageIndexChanging="gv_users_PageIndexChanging" EnableModelValidation="True" DataKeyNames="local_id"> <EmptyDataTemplate> Логи отсутствуют </EmptyDataTemplate> <Columns> <asp:BoundField DataField="local_id" HeaderText="LOCAL_ID" SortExpression="local_id"> <ItemStyle HorizontalAlign="Center" Width="7%" /> <HeaderStyle HorizontalAlign="Center" /> </asp:BoundField>
<asp:BoundField DataField="date_load" HeaderText="...." SortExpression="date_load"> <ItemStyle HorizontalAlign="Center" Width="15%" /> <HeaderStyle HorizontalAlign="Center" /> </asp:BoundField>
<asp:BoundField DataField="date_file" HeaderText="..." SortExpression="date_file"> <ItemStyle HorizontalAlign="Center" Width="15%" /> <HeaderStyle HorizontalAlign="Center" /> </asp:BoundField>
<asp:BoundField DataField="message" HeaderText="..." SortExpression="message"> <ItemStyle HorizontalAlign="Center" Width="43%" /> <HeaderStyle HorizontalAlign="Center" /> </asp:BoundField> <asp:TemplateField HeaderText="..."> <ItemStyle HorizontalAlign="Center" Width="43%" /> <HeaderStyle HorizontalAlign="Center" /> <ItemTemplate> <%# (Eval("id_ads") != null?("<a href=http://.../" + Eval("id_ads").ToString() + ".html>" + Eval("id_ads").ToString() + "</a>") : " ") %> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </Content> </ajax:AccordionPane> <ajax:AccordionPane runat="server" ID="Errors"> <Header>Ошибки</Header> <Content> <asp:GridView ID="GridView2" runat="server" AllowPaging="True" OnSorting="gv_users_Sorting" GridLines="none" AllowSorting="true" AutoGenerateColumns="False" PageSize="30" Width="100%" ShowFooter="True" OnPageIndexChanging="gv_users_PageIndexChanging" EnableModelValidation="True" DataKeyNames="local_id"> <EmptyDataTemplate> Логи отсутствуют </EmptyDataTemplate> <Columns> <asp:BoundField DataField="local_id" HeaderText="LOCAL_ID" SortExpression="local_id"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" Width="7%" /> </asp:BoundField>
<asp:BoundField DataField="date_load" HeaderText="..." SortExpression="date_load"> <HeaderStyle HorizontalAlign="Center" /> <ItemStyle HorizontalAlign="Center" Width="15%" /> </asp:BoundField>
<asp:BoundField DataField="date_file" HeaderText="..." SortExpression="date_file"> <ItemStyle HorizontalAlign="Center" Width="15%" /> <HeaderStyle HorizontalAlign="Center" /> </asp:BoundField>
<asp:BoundField DataField="message" HeaderText="..." SortExpression="message"> <ItemStyle HorizontalAlign="Center" Width="43%" /> <HeaderStyle HorizontalAlign="Center" /> </asp:BoundField> <asp:TemplateField HeaderText="..."> <ItemStyle HorizontalAlign="Center" Width="43%" /> <HeaderStyle HorizontalAlign="Center" /> <ItemTemplate> <%# (Eval("id_ads") != null?("<a href=http://.../" + Eval("id_ads").ToString() + ".html>" + Eval("id_ads").ToString() + "</a>") : " ") %> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> </Content> </ajax:AccordionPane> </Panes> </ajax:Accordion> </p> </asp:View> </asp:MultiView>
</ContentTemplate> </asp:UpdatePanel>
protected void ProgressBar1_RunTask(object sender, EO.Web.ProgressTaskEventArgs e) { Import imp = new Import();
XmlDocument doc = imp.begin_read_xml("http://.../import_data.xml", 8);
e.UpdateProgress(0);
imp.date = DateTime.Parse(doc.DocumentElement.SelectSingleNode("generation_date").InnerText);
int i = 0; int count = doc.DocumentElement.SelectNodes("ads").Count;
foreach (XmlNode node in doc.DocumentElement.SelectNodes("ads")) {
imp.read_node(node); i++;
if(i!=count) e.UpdateProgress(i*100 / count); }
//delete ads imp.client_ads.ForEach(item => { imp.delete_ads(item.id_ads, item.local_id, imp.date, imp.id_client); });
DataSet ds = Import.select_logs(8, 0); SetViewState(ds, "logs"); GridView1.DataSource = ds; GridView1.DataBind();
e.UpdateProgress(100); }
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Thanks for posting in the forum. Because ProgressBar is a free control, we only provide free support for ProgressBar for paid customers. So please let us know if you have a license for any of our product. You can PM us with your order number if you do have a license.
|