This is a migrated thread and some comments may be shown as answers.

[Solved] access data from radgrid ajax control in asp.net mvc application controller

0 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Hilda
Top achievements
Rank 1
Hilda asked on 30 Nov 2010, 12:06 PM

Hi,

I am new to using Telerik and asp.net. The application I'm trying to build uses telerik ajax controls in asp.net MVC2 application. I have used a Telerik RadGrid of Ajax in my view of the mvc2 application as follows:



<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>  


 I want to access the selected values from the RadGrid in my controller(atleast the key value). How can I do that?

Thanks in advance,
Hilda
Tags
Grid
Asked by
Hilda
Top achievements
Rank 1
Share this question
or