CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP.NET - InMotion Framework

 MTImageButton OnClick Event in EditableGrid

Print topic Send  topic

Author Message
cvboucher

Posts: 191
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  
	ISUtility.BookletTemplatePageUtility.MoveTemplatePageUp(TPID.Value, Seq.Value)  
End If  

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.

Thanks,
Craig
View profile  Send private message
cvboucher

Posts: 191
Posted: 05/17/2010, 9:45 AM

Nevermind, I found the answer from a similar question I posted six months ago.

((MTButton)sender).Parent.FindControl("<Hidden control name>")

Craig

View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.