I have a problem with updating a datagrid to a database. Everything else works fine except i cannot get the value i just edited. What's the correct syntax for this?<BR><BR>response.write e.Item.Cells(x).Controls(x) will give me only<BR>the values that were in the column in the grid PREVIOUS to<BR>my text change in it.... How would i get the correct value?<BR>I'm in the Datagrid1_update<BR><BR>Thanks<BR>Anders<BR>I think you are using a Custom Column in datagrid<BR><BR>REfer to professional asp.net Wrox page 339<BR><BR>use mvACCODE = CType(e.Item.FindControl("dftACCODE"), TextBox).Text<BR>msg.text mvACCODE <BR><BR>the cells(X) is not supported in custom column<BR><BR>another interesting solution for CheckboxList and DropDownList<BR>I think you will need this below later on<BR>'-------------------------------------------------------------<BR><BR> Dim mvC As CheckBoxList = CType(e.Item.FindControl("dftWHEREUSE"), CheckBoxList)<BR> Dim mvS As String = ""<BR> Dim objItem As ListItem<BR> For Each objItem In mvC.Items<BR> If objItem.Selected Then mvS = mvS & objItem.Value<BR> Next<BR>msg.text mvS<BR><BR>'---------------------------------------------------------<BR>I am still trying the Dynamic DropDownLIst from dataset or hashtable<BR>the checkboxlist cannot be foundWhere do U set the textbox values?<BR>If U do it in Page_Load and don't set that the values only should be set if page is not postback the the old values will be retrieved....<BR><BR>/stegoPlease refer to page 513 to 525 of Wrox "Biginning ASP.NET useing VB.Net" there is a good exapmle<BR><BR>You set the textbox value on 2 occasions<BR><BR>1) When in [Edit Mode] and you have Datbind to the Datagrid and trigger<BR> the edit mode <edit template> by OneditCom,mand = "subname_edit"<BR> you set the (DG.EditItemIndex = e.item.itemindex) in the subroutine<BR> the page will go into the <edititemtemp[late> section of the predefinied<BR> DG which has the <asp.textbox><BR><BR> After editing or canceling you set the [DG.EditItemIndex = -1] into Browse Mode as <ItemTemplate><BR> <BR> Page 272 of sams "ASP.NET tips and tutorials and code" has an edit example<BR><BR>2) when in [ADD Mode] you create a blank row and addrow to the dataset which<BR> is binded tothe Datagrid<BR><BR> One way is not to write the blank record back into the database.<BR> You can do a single record select to get the datadictionory item then<BR> it is easier to init the fields otherwsie you have to create the individual<BR> column fields in the datagrid, then init the fields of the textbox eg ID='UserID'<BR><BR><BR> Dim newrow as datarow<BR> newrow.Item("UserID") = "new" 'can get from auto ID File<BR> newrow.Item("UserName") =""<BR> newrow.Item("UserTel") = ""<BR> Datasetx.Tables(0).Rows.Add(newrow)<BR> DG.DataSourcxe = Datasetx.Tables(0).DefaultView '* could have stored in session Var<BR> DG.CurrentPageINdex = 0<BR> DG.EditItemIndex = 0<BR> DG.PageSize = "1"<BR> DG.Databind()<BR><BR> Not many books have sample on how to do the [ADD] Part. They will are you create another<BR> dataEntry section with <asp:textbox> within an <aspANEL> control column session and do the add.<BR> <BR> It is very basic requirement for masetr file mainteneance to has:<BR> [Search][Edit][Add][Delete][Save][Cancel][Exit] I donot understand why this part if left to the<BR> programer, there should be a standard library component. Otherwsie the DataGrid Control is only<BR> good for data presentation and maintanence.<BR><BR> A very good example is in the "101 ORACLE Web Applications" (Osborne) Page 258<BR>