Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to access a value in a selected row in mmRadGrid
Message
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01286766
Message ID:
01286832
Views:
18
This message has been marked as the solution to the initial question of the thread.
>Hello all,
>
>I have added a 'Select' column to a mmRadGrid and can successfully select a row in the grid. What I need to know is how do I access the values for one (or all) of the columns in the grid?
>
>I want to launch a new query when the row is selected based on the value(s) on that row. I have created an ItemCommand event and can successfully access the selected index of the grid, but I have yet to figure out how to access the value of a column in the selected row.
>
>Thanks in advance for any help in this matter.

This is really more specific to the Telerik controls - you'd probably have more luck asking this kind of question over on their forums.

Having said that, you usually just specify the key columns in the grid control in the "MasterTableView" section, eg.
<radG:RadGrid ...>
   <MasterTableView DataKeynames="YourPrimaryKeyFieldHere">

   </MasterTableView>
</radG:RadGrid>
Then from the code-behind you can access these values from the GridCommandEventArgs parameter:
// e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["YourPrimaryKeyFieldHere"]
You can actually access the other rows, but I've never had much luck doing that since the ItemIndex may not actually match the row number in your original binding source. So I'll normally just retrieve the single record based on the primary key if I need some other info.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform