如何控制 UltraWebGrid 控件中日期列的默认日期?
我使用 Infragistics UltraWebGrid 控件并具有以下布局:
<igtbl:UltraWebGrid ID="uwgPrescribedTrainingPlan" runat="server" Browser="Auto">
<Bands>
<igtbl:UltraGridBand DataKeyField="TRAININGPLANID">
<Columns>
...
<igtbl:UltraGridColumn HeaderText="Training Start Date" Key="STARTDATE" BaseColumnName="STARTDATE"
DataType="System.DateTime" Format="MM-dd-yy" EditorControlID="wdcDateChooser" />
<igtbl:UltraGridColumn HeaderText="Training End Date" Key="ENDDATE" BaseColumnName="ENDDATE"
DataType="System.DateTime" Format="MM-dd-yy" EditorControlID="wdcDateChooser" />
...
</Columns>
</igtbl:UltraGridBand>
</Bands>
</igtbl:UltraWebGrid>
两个重要的列是 STARTDATE
和 ENDDATE
。两者都允许用户使用日历控件编辑单元格。
现在,如果您更改 ENDDATE
单元格的值,选择器将默认为当前日期。我想要的是默认为 STARTDATE
列的值(如果有的话)。
我浏览了文档并没有找到太多内容,而且客户端脚本 API 似乎完全没有文档记录。有谁知道这是否可以做到?
更新:
我可以将处理程序附加到 wdcDateChooser
的 AfterDropDown
事件,但是在该处理程序中我看不到任何获取行的方法我点击了网格。
I'm using the Infragistics UltraWebGrid control and have the following layout:
<igtbl:UltraWebGrid ID="uwgPrescribedTrainingPlan" runat="server" Browser="Auto">
<Bands>
<igtbl:UltraGridBand DataKeyField="TRAININGPLANID">
<Columns>
...
<igtbl:UltraGridColumn HeaderText="Training Start Date" Key="STARTDATE" BaseColumnName="STARTDATE"
DataType="System.DateTime" Format="MM-dd-yy" EditorControlID="wdcDateChooser" />
<igtbl:UltraGridColumn HeaderText="Training End Date" Key="ENDDATE" BaseColumnName="ENDDATE"
DataType="System.DateTime" Format="MM-dd-yy" EditorControlID="wdcDateChooser" />
...
</Columns>
</igtbl:UltraGridBand>
</Bands>
</igtbl:UltraWebGrid>
The two important columns are STARTDATE
and ENDDATE
. Both allow users to edit the cell using a calendar control.
Right now, if you change the value of an ENDDATE
cell, the picker will default to the current date. What I want is to default to the value of the STARTDATE
column (if there is one).
I've looked around the docs and didn't find much, and the client side scripting API seems to be completely undocumented. Does anyone know if this is possible to do?
UPDATE:
I can attach a handler to the AfterDropDown
event of wdcDateChooser
, however in that handler I don't see any way to get the row I clicked on in the grid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信我有解决办法。我已将以下 Javascript 附加到
WebDateChooser
控件的AfterDropDown
事件,如下所示:Javascript函数如下:
I believe I have a solution. I've attached the following Javascript to the
AfterDropDown
event of theWebDateChooser
control like so:<ClientSideEvents AfterDropDown="InitEndDateDefault"></ClientSideEvents>
The Javascript function is as follows: