Hello,
I have some troubles with radgrid insert from. When i click on add new, my popup shows. On this form I want to check some values in one textbox. So I added a linkbutton to execute my method.
Problem is that i can set textbox to some value, but can't read from it.
PROBLEM ( stPoste = posta.Text;)
Any help ?
Thanks in advance.
Strela
I have some troubles with radgrid insert from. When i click on add new, my popup shows. On this form I want to check some values in one textbox. So I added a linkbutton to execute my method.
Problem is that i can set textbox to some value, but can't read from it.
PROBLEM ( stPoste = posta.Text;)
Any help ?
Thanks in advance.
Strela
public void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
{ |
if (e.CommandName == RadGrid.InitInsertCommandName) |
{ |
e.Canceled = true; |
e.Item.OwnerTableView.InsertItem(); |
GridEditableItem insertedItem = e.Item.OwnerTableView.GetInsertItem(); |
TextBox drzava = insertedItem.FindControl("TextBox_drzava") as TextBox; |
drzava.Text = "Slovenija"; |
TextBox id_sod = insertedItem.FindControl("TextBox_idsod") as TextBox; |
id_sod.Text = Profile.stevilkaSodelavca; |
} |
if (e.CommandName == "Add") |
{ |
e.Canceled = true; |
e.Item.OwnerTableView.InsertItem(); |
//PODATKI IZ BAZE |
String strKraj = ""; |
String stPoste = "0"; |
GridEditableItem insertedItem = RadGrid1.MasterTableView.GetInsertItem(); |
TextBox posta = insertedItem.FindControl("TextBox_posta") as TextBox; |
stPoste = posta.Text; //HERE I GOT "" (empty string) |
TextBox drzava = insertedItem.FindControl("TextBox_drzava") as TextBox; |
drzava.Text = "Slovenija"; |
TextBox id_sod = insertedItem.FindControl("TextBox_idsod") as TextBox; |
id_sod.Text = Profile.stevilkaSodelavca; |
TextBox kraj = insertedItem.FindControl("TextBox_kraj") as TextBox; |
kraj.Text = strKraj; |
} |
} |