在我的 gridview 中,我使用 MKB Timepicker 让用户输入时间。现在我想在gridview中添加一个下拉列表,当用户选择下拉列表时,它会自动刷新timepicker值(开始时间,结束时间)。但我不知道如何在行更新/编辑模板时刷新值。请帮忙。
谢谢乔
ASP 代码:
<EditItemTemplate>
<asp:DropDownList ID="ddl1_shifttype" runat ="server" AutoPostBack ="true" DataSourceID="SqlDataSource2" DataTextField ="en_name" DataValueField ="shift_type_key" SelectedValue='<%# Bind("Col1_ShiftType") %>' OnSelectedIndexChanged ="ddl1_shifttype_SelectedIndexChanged"></asp:DropDownList>
From:
<MKB:TimeSelector ID="Col1_StartTime" runat="server" DisplaySeconds="False" MinuteIncrement="1" BorderColor="Silver"
Date="" SelectedTimeFormat="Twelve"
Hour='<%#DataBinder.Eval(Container.DataItem, "Col1_StartTimeHr")%>'
Minute ='<%#DataBinder.Eval(Container.DataItem, "Col1_StartTimeMin")%>'
AmPm ='<%#DataBinder.Eval(Container.DataItem, "Col1_StartTimeAMPM")%>'></MKB:TimeSelector>
To:
<MKB:TimeSelector ID="Col1_EndTime" runat="server" DisplaySeconds="False" MinuteIncrement="1" BorderColor="Silver"
Date="" SelectedTimeFormat="Twelve"
Hour='<%#DataBinder.Eval(Container.DataItem, "Col1_EndTimeHr")%>'
Minute ='<%#DataBinder.Eval(Container.DataItem, "Col1_EndTimeMin")%>'
AmPm ='<%#DataBinder.Eval(Container.DataItem, "Col1_EndTimeAMPM")%>'></MKB:TimeSelector>
</EditItemTemplate>
SelectIndexChange 事件:
Protected Sub ddl1_shifttype_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddl1_shifttype.SelectedIndexChanged
'Testing
Col1_StartTime.Hour = "09"
Col1_StartTime.Minute = "33"
Col1_StartTime.AmPm = TimeSelector.AmPmSpec.PM
End Sub