Monday, March 26, 2012

Access Properties in codebehind

How can i access properties of DragPanel in codebehind?

For example, in test.aspx i have DragPanel, i want change the DragHandleID property in codeBehind... ? I cant access it. Thanks for any reply.

ThoNT

Assuming it's the first one in the list...

dragPanelExtender1.TargetProperties[0].DragHandleID = "newHandleID";


sburke_msft:

Assuming it's the first one in the list...

dragPanelExtender1.TargetProperties[0].DragHandleID = "newHandleID";

but if's not the first one in the list... and we dont know the index of it. (because we creat it by an for looping)


Well you can also look at the TargetID property to see which control it's extending

Hi ThoNT,

I think the easiest way to dynamically get the properties is to use the control you attached the extender to (i.e. the control you're setting as the "TargetControlID"). You can just do the following:

DragPanelProperties properties = dragPanelExtender1.GetTargetProperties(myControl1);if (properties !=null){ properties.DragHandleID ="newHandleID";}

Thanks,
Ted


Thank Ted Glaza.

i have just know functionGetTargetProperties from you!

No comments:

Post a Comment