I have a grid that has the "Add new record" button clicked showing the textbox with Role: [TextBox] and the checkbox and cancel buttons below it. The grid has only one columncalled RoleName with a title of Role as shown below.
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();
}