Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 25064

SPGridView issues

$
0
0

Please provide suggestions for these questions:

1. I am using SPMenuField in spgridivew which uses a MenuTemplate to show context menu items.

Problem is, if MenuTemplate does not have any items in it then the SPMenuField shows the column but text/menu for this column in the rows dissapears.

Right now I have solved this by using empty menu item like this MenuItemTemplate testMenu = new MenuItemTemplate("", ""). Is there any other way to solve this.

2. I require a default action for SPMenuField item just like sharepoint. NavigateURLFormat property allows to redirect to a link. Is there a way to call javascript in NavigateURLFormat property.

3. I use a TemplateField in spgridivew. TemplateField dissapears during postback. Right now I have solved this by adding TemplateField to spgridview during Page_SaveStateComplete event of the page as suggested in this link http://connect.microsoft.com/VisualStudio/feedback/details/104994/templatefield-in-a-gridview-doesnt-have-its-viewstate-restored-when-boundfields-are-inserted
. But it is difficult to manage in this event. Is there a way to solve this problem and make templatefield work like other fields.

Note: Along with TemplateField I use BoundField, SPMenuField which work fine during postbacks.

4. Using SPMenuField  shows same menu items for all the rows in the grid. Is there a way to show context sensitive menu for SPGridView which has to be like ECB menu and to have unique menu items for each row.


Viewing all articles
Browse latest Browse all 25064

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>