Hi all. I�m a newbie using asp.net but i�m getting along with it! :) Now i have a little problem that is bugging me alot cause i need it solved!
I have a datagrid that can be filled by a dataset or a reader. Everything works fine. I always use a template column for editing and deleting records on the datagrid with no problem at all. When i update a record i use an update statement like this: "Update Table1 SET field = newvalue Where field = oldvalue" When i edit a record (textbox in the datagrid) i get the old value like this: Dim oldvalue As String = dgrid.Items.Item(e.Item.ItemIndex).Cells(3).Text for values in the 4th column. I get the new value like this: Dim newvalue As String = CType(e.Item.Cells(3).Controls(0), TextBox).Text for the 4th column as well. The i use an update statement like this: "Update Table1 SET field = '" + newvalue + "' Where field = '" + oldvalue + "' " Everything works great! Now my problem is that i have some datagrids that have some template columns with dropdowlist when we edited them. (instead of appearing a textbox it appears a ddl just like this http://aspnet.4guysfromrolla.com/demos/dgExample16.aspx ). what i want is to get the old value cause i know to get the new one: Dim newvalue As String = CType(e.Item.FindControl("name of control"), DropDownList).SelectedItem.Value() when i use the Dim oldvalue As String = dgrid.Items.Item(e.Item.ItemIndex).Cells(3).Text it gives me nothing and i just dunno why! it gives me a blank nothing! Why is this possible if i ask the datagrid for the value and i know it is not empty? Can anyone please help me? In this particular work i�m doing i can�t use id like autonumber and my datagrid has 4 columns (all dropdowlist) and i want to edit them all! Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
