How can I set the commandArgument for rows in the codebehind ?
Ive tried this, but I get an error
<telerik:GridButtonColumn CommandName="Select" Text="Select" CommandArgument= '<%# Eval ( "UserID" ) %>' |
UniqueName="SelectButton"> |
</telerik:GridButtonColumn> |
'Error Creting Control'
Databinding Expressions are only supported on objects that have a databinding event.
I need to gain access to the underlying datakey so that when a user selects a row I have some code that select data from a database using the datakey as the primary key into the table. In a standard .net grid Id do this and it works
protected void GridViewArtistName_RowCommand(object sender, GridViewCommandEventArgs e) |
{ |
if (e.CommandName == "Select") |
{ |
|
Guid guid = new Guid(e.CommandArgument.ToString()); |
Session.Add("USERID", e.CommandArgument.ToString()); |
|
if (UserIDChange != null) |
{ |
// Call the Event |
UserIDEventArgs E = new UserIDEventArgs(guid); |
OnUserId(E); |
} |
} |
} |
How can I achieve the same functionality with a telerik grid ?