Create PopupContainer Control with Code?

Hi,
I have a web page that creates a web page with a GridGroupControl where some of the HeaderColumns are Buttons that are linked to a PopupControlContainer. The PopupControlContainer has a menu that is dynamically created in code and added to the PopupContainer. So, when the user does a right-click on the header the menu will popup. I would like to also create the PopupContainer dynamically in code but I am trying to figure out how to handle events? In the example I created (with help from Syncfusion - thanks guys!) the PopupContainerControl is already on the page and the client-side events are handled by checking _sfPopupContralContainer1.IsHidden in a client-side function. But how do I handle the client-side functions with dynamic control content? I do have an Event to catch the menu selection but I also need the column header index.

Thanks.
David.

7 Replies

AD Administrator Syncfusion Team September 8, 2006 12:08 AM UTC

Hi David,

The attached sample may fill up your requirement,regarding PopupControlContainer over the GridGroupingControl.

Actaully this Sample is the modified version from the link,
http://www.syncfusion.com/support/forums/message.aspx?MessageID=48626


The PopupContainer is made in such a way that it may popup when the user "Right Clicks" over the Button in Header of the Grid.

The handling of all client-side functions, mentioned in the sample, were made from the Server Side by specifying the parent control''s ID.

And too, its not possible to get the column header index from the popup control because we show the popup with respect to the header cell and not with respect to the button. So according to now we need separate poups for each columns.

I hope this Sample may help you and give the solution of your problem.

PopupMenuUnderGrid


Thanks,
G.Pradeep.


DA David A. Gonzales September 8, 2006 04:46 PM UTC

Thanks for the sample. It looks like it will do what I am after. The only problem is I cannot run the sample. The version number is 4.302.0.16 on the controls so I changed the version number to my (4.202.0.37) but now I cannot find the ClientObjectID for the PopupControlContainer. Is this because you are using the new version?

Thanks.
David.


AD Administrator Syncfusion Team September 8, 2006 08:51 PM UTC

Hi David,

Sorry for the Inconveniences caused.

The attached Sample contains the modified files of the previous Sample.

The ClientObjectId is the new property included into the latest version,

I have commented the lines of ClientObjectId under the C# Code Behind file and i have modified the Script Block by replacing the MyPopup1 and MyPopup2 with ''_sfPop1'' and ''_sfpop2'' respectively.

ModifiedMenuInHeaderSample



Thanks for using syncfusion products.

Thanks,
G.Pradeep




DA David A. Gonzales September 11, 2006 04:37 PM UTC

Thanks that works great. However I have a question regarding using this code in a paged grid. We have a custom paged grid (we handle all the paging with code and buttons). I put the menu on the column dynamically (using header template and popupcontrol containers) and I can do a right-click and bring up the menu. However, once I page I do a right-click and the menu no longer comes up. I do rebuild the header template and popupcontrol container each time. Do you have an example or at least tell me where I am going wrong. I am new to ASP.NET so it''s probably my lack of understanding.

Thank you.
David.


PG Pradeep G Syncfusion Team September 11, 2006 09:27 PM UTC

David,

I couldn''t reproduce the issue by using our Grid''s default pager Bar.

It could be glad if you furnish me a small Sample inorder to make us understand and reproduce the issue.

Thanks,
G.Pradeep.


DA David A. Gonzales September 12, 2006 01:40 PM UTC

Would it be possible to send your sample so I could see where I am going wrong? My sample is a bit complex (ie, multiple SQL databases, remote services, etc). I have a feeling its just in the way I am rebuilding everything after I page to a new set of data since I am handling all the paging myself.

Thanks.
David.


AD Administrator Syncfusion Team September 12, 2006 06:57 PM UTC

Hi David,

The attached Sample contains the default Navigator Bar Control from the GridGrouping Control.
MenuInheader_Navigation


For your kind attention, there is no much change in the samples code that we sent you previously. we just added the Navigation bar.

Thanks,
G.Pradeep.


Loader.
Up arrow icon