3 Answers, 1 is accepted
0
Princy
Top achievements
Rank 2
answered on 11 Mar 2010, 08:50 AM
Hi,
Could you make sure that you are following a similar approach to enable the Header Context Menu.This is working fine on my end
C#
Princy
Could you make sure that you are following a similar approach to enable the Header Context Menu.This is working fine on my end
C#
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if ( !IsPostBack ) |
| { |
| RadGrid1.DataSourceID = "SqlDataSource1"; |
| RadGrid1.MasterTableView.DataKeyNames = new string[] { "CustomerID" }; |
| RadGrid1.Width = Unit.Percentage(98); |
| RadGrid1.PageSize = 5; |
| RadGrid1.AllowPaging = true; |
| RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric; |
| RadGrid1.AutoGenerateColumns = false; |
| RadGrid1.Skin = "Web20"; |
| //Add Customers table |
| RadGrid1.MasterTableView.PageSize = 15; |
| RadGrid1.MasterTableView.EnableHeaderContextMenu = true; |
| RadGrid1.MasterTableView.Width = Unit.Percentage(100); |
| GridBoundColumn boundColumn; |
| boundColumn = new GridBoundColumn(); |
| RadGrid1.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.DataField = "CustomerID"; |
| boundColumn.HeaderText = "CustomerID"; |
| boundColumn = new GridBoundColumn(); |
| RadGrid1.MasterTableView.Columns.Add(boundColumn); |
| boundColumn.DataField = "ContactName"; |
| boundColumn.HeaderText = "Contact Name"; |
| } |
| } |
Princy
0
Lee Springthorpe
Top achievements
Rank 1
answered on 11 Mar 2010, 05:56 PM
Hi,
I have just come across the same problem, just upgraded to 2010.1.309.35 from 2009.3.1103.35. Worked fine in the older version, in the new version when clicked on the item in the menu nothing happens and the menu closes.
<!-- HTML -->
<telerik:RadGrid ID="RadOrders" runat="server" AllowPaging="True" PageSize="30">
</telerik:RadGrid>
<!--Code Behind-->
RadOrders.DataSource = somedatasource;
RadOrders.MasterTableView.DataKeyNames = new string[] { "OrderID" };
// RadGrid Styles
RadOrders.Width = Unit.Percentage(100);
RadOrders.PageSize = 10;
RadOrders.AllowPaging = true;
RadOrders.AutoGenerateColumns = false;
RadOrders.Skin = "Default";
RadOrders.EnableHeaderContextMenu = true;
RadOrders.MasterTableView.Width = Unit.Pixel(100);
RadOrders.ClientSettings.Scrolling.AllowScroll = true;
RadOrders.ClientSettings.Scrolling.UseStaticHeaders = true;
RadOrders.ClientSettings.Scrolling.SaveScrollPosition = true;
RadOrders.ClientSettings.EnableRowHoverStyle = true;
RadOrders.ClientSettings.AllowColumnHide = true;
// RadGrid Columns
GridBoundColumn boundColumn = new GridBoundColumn();
boundColumn.DataField = "Style";
boundColumn.HeaderText = "Style";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(120);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "PO";
boundColumn.HeaderText = "P.O.";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(60);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Cons";
boundColumn.HeaderText = "Docket";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(60);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Splr";
boundColumn.HeaderText = "Supplier";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(200);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Qty";
boundColumn.HeaderText = "Qty.";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(60);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Description";
boundColumn.HeaderText = "Description";
boundColumn.ItemStyle.Width = boundColumn.HeaderStyle.Width = Unit.Pixel(250);
RadOrders.MasterTableView.Columns.Add(boundColumn);
RadOrders.DataBind();
Not recieving any javascript errors, could i be missing any thing that has been added to the new version?
I have just come across the same problem, just upgraded to 2010.1.309.35 from 2009.3.1103.35. Worked fine in the older version, in the new version when clicked on the item in the menu nothing happens and the menu closes.
<!-- HTML -->
<telerik:RadGrid ID="RadOrders" runat="server" AllowPaging="True" PageSize="30">
</telerik:RadGrid>
<!--Code Behind-->
RadOrders.DataSource = somedatasource;
RadOrders.MasterTableView.DataKeyNames = new string[] { "OrderID" };
// RadGrid Styles
RadOrders.Width = Unit.Percentage(100);
RadOrders.PageSize = 10;
RadOrders.AllowPaging = true;
RadOrders.AutoGenerateColumns = false;
RadOrders.Skin = "Default";
RadOrders.EnableHeaderContextMenu = true;
RadOrders.MasterTableView.Width = Unit.Pixel(100);
RadOrders.ClientSettings.Scrolling.AllowScroll = true;
RadOrders.ClientSettings.Scrolling.UseStaticHeaders = true;
RadOrders.ClientSettings.Scrolling.SaveScrollPosition = true;
RadOrders.ClientSettings.EnableRowHoverStyle = true;
RadOrders.ClientSettings.AllowColumnHide = true;
// RadGrid Columns
GridBoundColumn boundColumn = new GridBoundColumn();
boundColumn.DataField = "Style";
boundColumn.HeaderText = "Style";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(120);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "PO";
boundColumn.HeaderText = "P.O.";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(60);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Cons";
boundColumn.HeaderText = "Docket";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(60);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Splr";
boundColumn.HeaderText = "Supplier";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(200);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Qty";
boundColumn.HeaderText = "Qty.";
boundColumn.HeaderStyle.Width = boundColumn.ItemStyle.Width = Unit.Pixel(60);
RadOrders.MasterTableView.Columns.Add(boundColumn);
boundColumn = new GridBoundColumn();
boundColumn.DataField = "Description";
boundColumn.HeaderText = "Description";
boundColumn.ItemStyle.Width = boundColumn.HeaderStyle.Width = Unit.Pixel(250);
RadOrders.MasterTableView.Columns.Add(boundColumn);
RadOrders.DataBind();
Not recieving any javascript errors, could i be missing any thing that has been added to the new version?
0
Hello Lee,
Could you take a look at the help article and our online examples on the programmatic creation of the grid. If you are creating the grid on Page_Load you need to be adding the columns to the MasterTableView first and then set their properties in order for their ViewState to be tracked correctly. In addition, you should remove the DataBind() call from the grid-creation code as it is not needed as explained in the online examples on Simple and Advanced databinding and their related help articles.
I hope this information helps.
Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Could you take a look at the help article and our online examples on the programmatic creation of the grid. If you are creating the grid on Page_Load you need to be adding the columns to the MasterTableView first and then set their properties in order for their ViewState to be tracked correctly. In addition, you should remove the DataBind() call from the grid-creation code as it is not needed as explained in the online examples on Simple and Advanced databinding and their related help articles.
I hope this information helps.
Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.