|Posted: 05/16/2010, 10:31 PM
I have an editable grid with two image buttons, one an up arrow and another a down arrow. I want to use these two buttons to move rows up and down in the list. From within the OnClick event of the MTImageButton, how do I access other controls in the row? I need the values in these controls to move the current row up or down. Below is the code I'm using but I get a System.NullReferenceException: Object reference not set to an instance of an object error for TPID.
Dim TPID As MTHidden = BookletTemplatePage.GetControl(Of MTHidden)("BookletTemplateID")
Dim Seq As MTTextBox = BookletTemplatePage.GetControl(Of MTTextBox)("Sequence")
If Not String.IsNullOrEmpty(TPID.Value) And Not String.IsNullOrEmpty(Seq.Value) Then
I'm using the first two lines of the code in the BeforeShow event to hide the button if either of the two controls don't contain a value, so I'm sure the control names are correct.