I can't seem to get the blankety blank edited values out of the Rad Grid. Some code I been working on and of course all the stuff that is commented out I couldn't get to work.
Isn't there an easy way to get the value from an edited textbox. You know the stuff someone types in a textbox when they clicked on edit. Sheesh!
UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
(userControl.FindControl("admissionID") as TextBox).Text I keep getting errors on this guy. Null Reference and Object not set to an instance etc.
protected
void Update_Command(object source, Telerik.WebControls.GridCommandEventArgs e)
{
//GridEditableItem editedItem = e.Item as GridEditableItem;
//UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
This is what I'd like to do is get the blankety blank row ID of the row I'm editing
//string admissionID = (userControl.FindControl("admissionID") as TextBox).Text; I get error with object not set to....null reference etc. when code above is uncommented out for userControl
This is what I'd like to do is get the blankety blank edited stuff
//string ssn = (userControl.FindControl("ssn") as TextBox).Text; I get error with object not set to....null reference when code above is uncommented out for userControl
//UserControl userControl = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
//Hashtable newValues = new Hashtable();
//newValues["admissionID"] = (userControl.FindControl("admissionID") as TextBox).Text;
//newValues["ssn"] = (userControl.FindControl("ssn") as TextBox).Text;
//TextBox admissionIDTxBx = (TextBox)userControl.FindControl("admissionID");
//TextBox ssnIDTxBx = (TextBox)userControl.FindControl("ssn");
var db = new admissions_appsDataContext();
var query = from s in db.admission_app2s
where s.admissionID == "randysolutions@hotmail.com" would like to put admissionID grabed as edited row field identifier
select s;
foreach (var thisItem in query)
{
//foreach (DictionaryEntry entry in newValues)
//{
//if (thisItem.admissionID == admissionIDTxBx.Text)
thisItem.ssn =
"123456789"; would like to put ssn The stuff entered in the editable textbox as this code with everything commented out simply updates this row in the database.
//}
//if (thisItem.admissionID == (userControl.FindControl("admissionID") as TextBox).Text)
//{
// thisItem.ssn = "12345";//(userControl.FindControl("ssn") as TextBox).Text;
//}
}
db.SubmitChanges();
//var db = new admissions_appsDataContext();
//db.SubmitChanges(
var dbRefresh = new admissions_appsDataContext();
var queryRefresh = db.admission_app2s;
RadGrid1.DataSource = queryRefresh;
RadGrid1.DataBind();