0
我正在使用Daypilot日历。DayPilot - Gridview不刷新
我的问题是,每当有一个变化,如EventResize或EventMove在日历上在GridView应与最新值更新
例EventResize
protected void DayPilotCalendar1_EventResize(object sender, EventResizeEventArgs e)
{
int id = e.Recurrent ? Convert.ToInt32(e.RecurrentMasterId) : Convert.ToInt32(e.Id);
new DataManager_MasterRota().MoveAssignment(id, e.NewStart, e.NewEnd, e.NewStart.DayOfWeek);
DayPilotCalendar1.DataSource = new DataManager_MasterRota().GetAssignmentsForLocation(DayPilotCalendar1);
DayPilotCalendar1.DataBind();
DayPilotCalendar1.Update();
GridView1.DataBind();
}
的Gridview1.DataBind( )在事件调整大小时正在被命中,但它实际上并未刷新gridview上的数据。我必须点击F5刷新页面才能真正影响Gridview。
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical" Width="94px" DataSourceID="SqlDataSource1">
<AlternatingRowStyle BackColor="White" />
<Columns>
<asp:BoundField DataField="PersonId" HeaderText="PersonId" SortExpression="PersonId" />
<asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" ReadOnly="True" />
<asp:BoundField DataField="a" HeaderText="a" ReadOnly="True" SortExpression="a" />
</Columns>
<FooterStyle BackColor="#CCCC99" />
<HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
<RowStyle BackColor="#F7F7DE" />
<SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FBFBF2" />
<SortedAscendingHeaderStyle BackColor="#848384" />
<SortedDescendingCellStyle BackColor="#EAEAD3" />
<SortedDescendingHeaderStyle BackColor="#575357" />
</asp:GridView>
你的gridview是在一些面板? –
我试过它内部和没有更新面板,结果是相同的,它无法刷新更新gridview数据 –
我实际上已经将EventResize更改为回发,它的工作。可以使用Callback吗? –