【发布时间】:2010-11-30 10:57:29
【问题描述】:
我是使用 Telerik 和 asp.net 的新手。 我正在尝试构建的应用程序在 asp.net MVC2 应用程序中使用 Telerik ajax 控件。 我在 mvc2 应用程序的视图中使用了 Telerik RadGrid 的 Ajax,如下所示:
<form runat="server" id="form1" method="post">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<h2>Index</h2>
<telerik:RadGrid ID="RadGrid1" runat="server"
DataSourceID="SqlDataSource1" AllowPaging="True" GridLines="None"
AllowMultiRowSelection="True" Skin="Web20" AutoGenerateColumns="False">
<MasterTableView DataSourceID="SqlDataSource1" AllowFilteringByColumn="True"
DataKeyNames="Val1">
<CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
<telerik:GridBoundColumn DataField="Val1" HeaderText="Val1"
SortExpression="Val1" UniqueName="Val1">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="Val2" HeaderText="Val2" ReadOnly="True"
SortExpression="Val2" UniqueName="Val2">
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
<ClientSettings ActiveRowIndex="0" AllowKeyboardNavigation="True" >
<Selecting AllowRowSelect="True" />
</ClientSettings>
</telerik:RadGrid>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:SomeConnectionString %>"
SelectCommand="SELECT * FROM [someTable]"></asp:SqlDataSource>
<input type="submit" value="Submit"/>
</form>
我想从我的控制器中的 RadGrid 访问选定的值(至少是键值)。我该怎么做?
提前致谢, 希尔达
【问题讨论】:
标签: asp.net-mvc-2 asp.net-ajax telerik