Mar 27, 2004 #1 T TheWizardofInt Junior Contributor Joined Dec 31, 1969 Messages 333 Location Orlando, FL I need two edit columns in the datagrid How do I determine which has been clicked in the code behind section?
I need two edit columns in the datagrid How do I determine which has been clicked in the code behind section?
Mar 28, 2004 #2 R Robby Ultimate Contributor Joined Nov 17, 2002 Messages 3,460 Location Montreal, Ca. Try this... dim txt as texbox = CType(e.Item.Cells(1).Controls(0), TextBox) // Cell(1) being the column index or if you used TemplateColumn / EditItemTemplate to place the controls dim dd as Dropdownlist = CType(e.Item.FindControl("myDropdown"), DropDownList) BTW, the above code goes in the UpdateCommand event of the datagrid
Try this... dim txt as texbox = CType(e.Item.Cells(1).Controls(0), TextBox) // Cell(1) being the column index or if you used TemplateColumn / EditItemTemplate to place the controls dim dd as Dropdownlist = CType(e.Item.FindControl("myDropdown"), DropDownList) BTW, the above code goes in the UpdateCommand event of the datagrid