在我的 RadListView 上创建 SelectedIndexChanged 事件时,函数参数是(对象发送者,EventArgs e),而 e 并没有让我感到太多......需要更像 OnItemDataBound 的东西,其函数具有(对象发送者,RadListViewItemEventArgs e)。我尝试更改 EventArgs 的类型,但出现运行时错误,指出该函数已重载。我正在尝试获取所选项目(RadHtmlChart)并检查其样式,以便我可以根据选择或取消选择来更改它。我成功地通过客户端 javascript 调用来获取所选项目的 ID。我只需要找到选择中的控件,以便更改其样式(背景颜色)。谢谢!
`<telerik:RadListView ID="RdListView_Chart" runat="server" OnNeedDataSource="RdListView_Chart_OnNeedDataSource"
OnItemDataBound="RdListView_Chart_OnItemDataBound" Width="1200"
BorderColor="#666666" BorderStyle="Solid" BorderWidth="1px" ItemPlaceholderID="FoodTestContainer" >
<LayoutTemplate>
<legend></legend>
<asp:PlaceHolder ID="FoodTestContainer" runat="server"></asp:PlaceHolder>
<div style="clear: both"></div>
</LayoutTemplate>
<ItemTemplate>
<fieldset id="myfieldset" style="float:left; width:250px; height:250px; border-color:<%#(bool)Eval("IsInvalidYN") ? "red" : "black" %>;" >
<legend> <%#Eval("AntigenTranslation") %> </legend>
<a href="javascript:OnClientSeriesClicked('<%# Eval("ResultID") %>');">
<br />
<div runat="server" style="width:250px; height:190px;">
<telerik:RadHtmlChart ID="RadHtmlChart1" runat="server" Width="200" Height="200" ChartTitle-Appearance-TextStyle-Bold="true"
ChartTitle-Appearance-Position="Top" Legend-Appearance-Visible="false" PlotArea-XAxis-LabelsAppearance-Visible ="false"
PlotArea-XAxis-MajorGridLines-Visible="false" PlotArea-XAxis-MinorGridLines-Visible="false"
PlotArea-XAxis-MajorTickType="None" PlotArea-XAxis-MinorTickType="None" PlotArea-XAxis-TitleAppearance-Position="Left"
PlotArea-XAxis-TitleAppearance-TextStyle-FontSize="14" PlotArea-XAxis-TitleAppearance-TextStyle-Margin="0"
PlotArea-YAxis-LabelsAppearance-TextStyle-Padding="0" PlotArea-YAxis-MinorGridLines-Visible="false"
PlotArea-YAxis-MaxValue="160" PlotArea-YAxis-MinValue="0" >
<PlotArea>
<Series></Series>
</PlotArea>
</telerik:RadHtmlChart>
</div>
</a>
</fieldset>
</ItemTemplate>
</telerik:RadListView>
`
我可以在字段集上设置背景颜色,也可以在 RadHtmlChart1 元素上设置 PlotArea-Appearance-FillStyle-BackgroundColor。我在 OnSelectedIndexChanged 事件中什么也得不到。