4 Answers, 1 is accepted
0
Hello Richard,
Please examine the following links:
[EditForms / InPlace ]
Inserting values in-place and EditForms
[UserControl / FormTemplate]
Inserting values using UserControl/FormTemplate
Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Please examine the following links:
[EditForms / InPlace ]
Inserting values in-place and EditForms
[UserControl / FormTemplate]
Inserting values using UserControl/FormTemplate
Best regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Richard
Top achievements
Rank 1
answered on 16 Jun 2010, 03:05 PM
Thank you for the links to the examples. They are helpful but a little over my head with the knowledge I have right now.
If you view the attached jpg, you will see what I am trying to do. I have a grid that has the "Add new record" button clicked showing teh textbox with Role: [TextBox] and the checkbox and cancel buttons below it. When I click the checkbox button, I am firing the InsertCommand that uses an objectdatasource with three parameters (applicationId, applicationName, rolename). roleName needs to be the value of the textbox.
My grid is called gvRoles.
My objectdatasource is called dsSecurity.
Is there just a couple of lines of code that I can use to get this value?
If you view the attached jpg, you will see what I am trying to do. I have a grid that has the "Add new record" button clicked showing teh textbox with Role: [TextBox] and the checkbox and cancel buttons below it. When I click the checkbox button, I am firing the InsertCommand that uses an objectdatasource with three parameters (applicationId, applicationName, rolename). roleName needs to be the value of the textbox.
My grid is called gvRoles.
My objectdatasource is called dsSecurity.
Is there just a couple of lines of code that I can use to get this value?
protected void gvRoles_InsertCommand(object source, GridCommandEventArgs e) |
{ |
//I need code here to retrieve the value of the textbox |
dsSecurity.InsertMethod = "InsertRole"; |
String applicationId = cmbApplications.SelectedValue; |
String applicationName = cmbApplications.SelectedItem.Text; |
String roleName = "I need to set the role name from the textbox"; |
dsSecurity.InsertParameters["applicationId"].DefaultValue = applicationId; |
dsSecurity.InsertParameters["applicationName"].DefaultValue = applicationName; |
dsSecurity.InsertParameters["roleName"].DefaultValue = roleName; |
gvRoles.DataBind(); |
} |
0
Hello Richard,
Depending on your scenario, you could extract the values or get them from the edit controls:
Regards,
Daniel
the Telerik team
Depending on your scenario, you could extract the values or get them from the edit controls:
protected
void
RadGrid1_InsertCommand(
object
source, GridCommandEventArgs e)
{
GridEditableItem item = e.Item
as
GridEditableItem;
//Approach 1 - extract the value
Hashtable table =
new
Hashtable();
item.ExtractValues(table);
var myValue = table[
"MyDataField"
];
//Approach 2 - get the value from the control
RadTextBox tbox = item.FindControl(
"MyTextBox"
)
as
RadTextBox;
var myValue2 = tbox.Text;
}
Regards,
Daniel
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
ejb
Top achievements
Rank 2
answered on 26 Jun 2010, 10:08 PM
This was awesome thank you