| SplitterItemsCollection must contain SplitterItem objects |
| Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. |
| Exception Details: System.ArgumentException: SplitterItemsCollection must contain SplitterItem objects |
| Source Error: |
| An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. |
| Stack Trace: |
| [ArgumentException: SplitterItemsCollection must contain SplitterItem objects] |
| Telerik.Web.UI.SplitterItemsCollection.AddAt(Int32 index, Control child) +98 |
| Telerik.Web.UI.RadAjaxControl.MoveUpdatePanel(Control initiator, Control updated) +214 |
| Telerik.Web.UI.RadAjaxControl.PerformRender() +502 |
| Telerik.Web.UI.RadAjaxControl.OnPageRender(HtmlTextWriter writer, Control page) +1849 |
| Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +158 |
| System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +256 |
| System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 |
| System.Web.UI.Page.Render(HtmlTextWriter writer) +29 |
| System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 |
| System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 |
| System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 |
| System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266 |
| -------------------------------------------------------------------------------- |
| Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 |
| <telerik:RadSplitter ID= "mainSplitter" runat="server" Orientation="Vertical" ResizeMode="AdjacentPane" width="100%" |
| VisibleDuringInit="false" Height="100%" ResizeWithParentPane="true"> |
| <telerik:RadPane id="leftPane" runat="server" width="22" minwidth="22" Scrolling="none"> |
| <telerik:RadSlidingZone id="SlidingZone1" runat="server" clicktoopen="true" DockedPaneId="sPackages" ExpandedPaneId="sPackages" > |
| <telerik:RadSlidingPane id="sPackages" title="Packages" runat="server" width="215" Scrolling="Both" EnableResize="false" > |
| <telerik:RadGrid ID="packageGrid" runat="server" Width="200px" |
| DataSourceID="SqlDataSourcePackages" AutoGenerateColumns="False" |
| GridLines="None" > |
| <ClientSettings> |
| <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" /> |
| <ClientEvents OnRowSelected="rowSelected" /> |
| </ClientSettings> |
| <MasterTableView> |
| <Columns> |
| <telerik:GridBoundColumn DataField="package_id" UniqueName="package_id" Display="false"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="package_name" UniqueName="package_name" HeaderText="Package name" > |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </telerik:RadGrid> |
| </telerik:RadSlidingPane> |
| </telerik:RadSlidingZone> |
| </telerik:RadPane> |
| <telerik:RadSplitBar id="Radsplitbar3" runat="server" collapsemode="Forward" /> |
| <telerik:RadPane id="contentPane" runat="server" Scrolling="Y" > |
| <telerik:RadSplitter ID= "embeddedSplitter" runat="server" Orientation="Horizontal" ResizeMode="EndPane" width="100%" |
| VisibleDuringInit="false" Height="100%" ResizeWithParentPane="true"> |
| <telerik:RadPane ID="topPane" runat="server" ContentUrl="contentviewer.aspx?price=Y"> |
| </telerik:RadPane> |
| <telerik:RadSplitBar id="Radsplitbar2" runat="server" collapsemode="Both" /> |
| <telerik:RadPane ID="bottomPane" runat="server" Scrolling="Y"> |
| <table> |
| <tr> |
| <td> |
| Build your package here<br /> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| <telerik:RadGrid ID="buildPackageGrid" runat="server" |
| DataSourceID="SqlDataSourceselectPackage" AllowFilteringByColumn="True" |
| AllowPaging="True" GridLines="None" > |
| <ClientSettings> |
| </ClientSettings> |
| <MasterTableView runat="server" AutoGenerateColumns="False" PageSize="12" DataKeyNames="mid_id,mid_type_id"> |
| <GroupByExpressions> |
| <telerik:GridGroupByExpression> |
| <GroupByFields> |
| <telerik:GridGroupByField FieldName="mid_type_name" SortOrder="Descending"></telerik:GridGroupByField> |
| </GroupByFields> |
| <SelectFields> |
| <telerik:GridGroupByField FieldAlias="mid_type_name" FieldName="mid_type_name" HeaderText="Mid type" /> |
| </SelectFields> |
| </telerik:GridGroupByExpression> |
| </GroupByExpressions> |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <telerik:GridBoundColumn UniqueName="mid_id" DataField="mid_id" Display="false"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="mid_type_id" DataField="mid_type_id" Display="false"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="mid_name" DataField="mid_name" HeaderText="Package Contents" ></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="package_name" DataField="package_name" HeaderText="Package Name" SortExpression="package_name" Display="false"></telerik:GridBoundColumn> |
| <telerik:GridBoundColumn UniqueName="mid_type_name" DataField="mid_type_name" HeaderText="Mid type" SortExpression="mid_type_name"></telerik:GridBoundColumn> |
| </Columns> |
| <PagerStyle Mode="NextPrevNumericAndAdvanced" /> |
| </MasterTableView> |
| <FilterMenu EnableTheming="True"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </telerik:RadGrid><br /><br /> |
| <asp:Button ID="deleteButton" runat="server" Text="Click to unselect" OnClientClick="return clickedDelete();" /> |
| </td> |
| <td> |
| <asp:Button ID="selectButton" runat="server" Text="Click to select" OnClientClick="return clickedSelect();" /><br /><br /><br /> |
| <asp:Button ID="boundButton" runat="server" Text="Click after grid is bound" OnClientClick="return clickedBound();" /> |
| </td> |
| </tr> |
| </table> |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
| </telerik:RadPane> |
| </telerik:RadSplitter> |
for (var i = 0; i < grid.MasterTableView.SelectedRows.length; i++)
{
...
}
for
(var i = 0; i < grid.get_masterTableView().SelectedRows.length; i++)
{
...
now i got this objet do not have this properties.
any suggestion? Thanks
<
ClientSettings AllowKeyboardNavigation="True"
EnableRowHoverStyle="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="radGridProducts">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="radGridProducts" LoadingPanelID="AjaxLoadingPanel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</
telerik:RadAjaxManager>
<%
--<telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Height="75px"
Width="75px" Transparency="10">
<asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/Images/loading3.gif" />
</telerik:RadAjaxLoadingPanel>--
%>
<
asp:Label ID="lblMessage" runat="server" EnableViewState="False" Visible="false"></asp:Label><br />
<
telerik:RadGrid ID="radGridProducts" runat="server" AutoGenerateColumns="False"
AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" Skin="Office2007"
AllowMultiRowSelection="True" AllowMultiRowEdit="True" GridLines="None"
OnNeedDataSource="RadGridProducts_NeedDataSource" OnDeleteCommand="radGridProducts_DeleteCommand"
OnInsertCommand="RadGridProducts_InsertCommand" OnUpdateCommand="RadGridProducts_UpdateCommand"
OnDetailTableDataBind="RadGridProducts_DetailTableDataBind">
<AlternatingItemStyle BackColor="#EDEFF1" BorderColor="Blue" />
<PagerStyle AlwaysVisible="True" Position="TopAndBottom" />
<MasterTableView DataKeyNames="Tag,ParentTag,Id" CommandItemDisplay="Top" EditMode="InPlace">
<CommandItemTemplate>
<asp:LinkButton Style="vertical-align: bottom" ID="btnEditSelected" runat="server"
CommandName="UpdateEdited" Visible='<%# radGridProducts.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="../images/Update.gif" /> Update Products</asp:LinkButton>
<asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" CausesValidation="false" Visible='<%# radGridProducts.EditIndexes.Count > 0 || radGridProducts.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../images/Cancel.gif" /> Cancel editing</asp:LinkButton>
<asp:LinkButton ID="btnAddProduct" runat="server" CommandName="InitInsert" Visible='<%# !radGridProducts.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../images/AddRecord.gif" /> Add new Product</asp:LinkButton>
<asp:LinkButton ID="btnSaveProduct" runat="server" CommandName="PerformInsert" Visible='<%# radGridProducts.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="../images/Insert.gif" /> Add this Product</asp:LinkButton>
<asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="EditSelected" CausesValidation="false" Visible='<%# radGridProducts.EditIndexes.Count == 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="../images/Edit.gif" /> Edit Selected Products</asp:LinkButton>
<asp:LinkButton ID="btnDeleteSelectedProducts" OnClientClick="javascript:return confirm('Delete all selected Products?')"
runat="server" CommandName="DeleteSelected" CausesValidation="false"><img style="border:0px;vertical-align:middle;" alt="" src="../images/Delete.gif" /> Delete Selected Products</asp:LinkButton>
<asp:LinkButton ID="btnRefresh" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="../images/Refresh.gif" /> Refresh Product list</asp:LinkButton>
</CommandItemTemplate>
<RowIndicatorColumn>
<HeaderStyle Width="20px" />
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px" />
</ExpandCollapseColumn>
<Columns>
<telerik:GridEditCommandColumn ButtonType="ImageButton" UpdateImageUrl="../images/Update.gif"
EditImageUrl="../images/Edit.gif" InsertImageUrl="../images/Insert.gif" CancelImageUrl="../images/Cancel.gif"
UniqueName="EditCommandColumn">
<HeaderStyle Width="30px" />
</telerik:GridEditCommandColumn>
<telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"
ImageUrl="../images/Delete.gif" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
<HeaderStyle Width="20px" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridButtonColumn>
<telerik:GridClientSelectColumn>
<HeaderStyle Width="40px" />
</telerik:GridClientSelectColumn>
<telerik:GridBoundColumn ReadOnly="true" DataField="Tag" HeaderText="Tag" UniqueName="_colProductTag"
MaxLength="10">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ShortDescription" HeaderText="Short Description"
UniqueName="_colProductShortDesc" MaxLength="40">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="LongDescription" HeaderText="Long Description"
UniqueName="_colProductLongDescription" MaxLength="80">
</telerik:GridBoundColumn>
<telerik:GridHyperLinkColumn DataNavigateUrlFields="Id" DataNavigateUrlFormatString="javascript:ShowEditForm('{0}');"
HeaderText="Characteristics" Text="View" UniqueName="_colChar2">
</telerik:GridHyperLinkColumn>
</Columns>
</MasterTableView>
<ClientSettings AllowKeyboardNavigation="True"
EnableRowHoverStyle="True">
<Selecting AllowRowSelect="True" />
</ClientSettings>
<FilterMenu EnableTheming="True">
<CollapseAnimation Duration="200" Type="OutQuint" />
</FilterMenu>
private
void CreateHierarchyTableTemplates(int noOfLevels)
{
GridTableView parentTableView = radGridProducts.MasterTableView;
parentTableView.DetailTables.Clear();
for (int i = 0; i < noOfLevels; i++)
{
GridTableView newParentTableView = CreateProductChildGrid(parentTableView);
parentTableView = newParentTableView;
}
}
private GridTableView CreateProductChildGrid(GridTableView parentGridTableView)
{
GridTableView tableViewChildProduct = new GridTableView(radGridProducts);
parentGridTableView.DetailTables.Add(tableViewChildProduct);
tableViewChildProduct.DataSource =
new List<InstrProduct>();
AddProductChildGridAttributes(tableViewChildProduct);
tableViewChildProduct.EnableColumnsViewState =
true;
return tableViewChildProduct;
}
private void AddProductChildGridAttributes(GridTableView tableViewChildProduct)
{
tableViewChildProduct.PageSize = 100;
tableViewChildProduct.Width =
Unit.Percentage(100);
tableViewChildProduct.SkinID =
"Office2007";
tableViewChildProduct.AutoGenerateColumns =
false;
tableViewChildProduct.AllowPaging =
true;
tableViewChildProduct.EnableViewState =
true;
tableViewChildProduct.HierarchyLoadMode =
GridChildLoadMode.ServerOnDemand;
tableViewChildProduct.BorderColor =
Color.Blue;
tableViewChildProduct.PagerStyle.AlwaysVisible =
true;
tableViewChildProduct.PagerStyle.Position =
GridPagerPosition.TopAndBottom;
AddProductChildGridBoundColumns(tableViewChildProduct);
tableViewChildProduct.EnableColumnsViewState =
true;
tableViewChildProduct.EditMode =
GridEditMode.InPlace;
tableViewChildProduct.CommandItemDisplay =
GridCommandItemDisplay.Top;
tableViewChildProduct.CommandItemSettings.AddNewRecordText =
"Add new Product";
//tableViewChildProduct.CommandItemTemplate = new ProductCommandItemTemplate();
}
private void AddProductChildGridBoundColumns(GridTableView tableViewChildProduct)
{
GridEditCommandColumn col0 = new GridEditCommandColumn();
tableViewChildProduct.Columns.Add(col0);
col0.ButtonType =
GridButtonColumnType.ImageButton;
col0.UpdateImageUrl =
"../images/Update.gif";
col0.EditImageUrl =
"../images/Edit.gif";
col0.InsertImageUrl =
"../images/Insert.gif";
col0.CancelImageUrl =
"../images/Cancel.gif";
col0.UniqueName =
"EditCommandColumn";
GridButtonColumn col1 = new GridButtonColumn();
tableViewChildProduct.Columns.Add(col1);
col1.Text =
"Delete";
col1.ConfirmText =
"Delete this product?";
col1.ButtonType =
GridButtonColumnType.ImageButton;
col1.ImageUrl =
"../images/Delete.gif";
col1.CommandName =
"Delete";
col1.UniqueName =
"DeleteColumn";
GridClientSelectColumn col2 = new GridClientSelectColumn();
tableViewChildProduct.Columns.Add(col2);
GridBoundColumn col3 = new GridBoundColumn();
tableViewChildProduct.Columns.Add(col3);
col3.DataField =
"Tag";
col3.UniqueName = tableViewChildProduct.Name +
"_colTag";
col3.HeaderText =
"Tag";
col3.ReadOnly =
true;
GridBoundColumn col4 = new GridBoundColumn();
tableViewChildProduct.Columns.Add(col4);
col4.DataField =
"ShortDescription";
col4.UniqueName = tableViewChildProduct.Name +
"_colShortDescription";
col4.HeaderText =
"Short Description";
col3.MaxLength = 40;
GridBoundColumn col5 = new GridBoundColumn();
tableViewChildProduct.Columns.Add(col5);
col5.DataField =
"LongDescription";
col5.UniqueName = tableViewChildProduct.Name +
"_colLongDescription";
col5.HeaderText =
"Long Description";
col5.MaxLength = 80;
GridHyperLinkColumn col6 = new GridHyperLinkColumn();
tableViewChildProduct.Columns.Add(col6);
col6.UniqueName = tableViewChildProduct.Name +
"_colCharacteristics2";
col6.HeaderText =
"Characteristics";
col6.DataNavigateUrlFormatString =
"javascript:ShowEditForm('{0}');";
col6.DataNavigateUrlFields =
new string[] { "Id" };
col6.Text =
"View";
}
protected
void radGridProducts_DeleteCommand(object source, GridCommandEventArgs e)
{
RadGrid grid = source as RadGrid;
GridItemCollection itemsCollection = grid.SelectedItems;
switch(e.CommandName )
{
//Delete Selected Products Logic
case "DeleteSelected":
{
if (itemsCollection.Count > 0)
{
StringBuilder _sProdList = new StringBuilder();
StringBuilder _sProdDeletedList = new StringBuilder();
//List<InstrProduct> _productDeleteList = new List<InstrProduct>();
foreach (GridDataItem item in itemsCollection)
{
String _productTag = item.GetDataKeyValue("Tag").ToString();
String _productId = item.GetDataKeyValue("Id").ToString();
//Check if the productTag has a Child Level
List<InstrProduct> _lstProducts = _presenter.GetChildProducts(_productTag);
if (_lstProducts.Count == 0)
{
//Allow Delete as there are no child products
InstrProduct _productDelete = new InstrProduct();
_productDelete.Id =
Convert.ToInt32(item.GetDataKeyValue("Id"));
_productDelete.Tag = item.GetDataKeyValue(
"Tag").ToString();
//_productDeleteList.Add(_productDelete);
//Allow Delete as there are no child products
//int instrproductDel = _presenter.DeleteProduct(_productDeleteList);
int instrproductDel = _presenter.DeleteProduct(_productDelete);
e.Item.OwnerTableView.Rebind();
_sProdDeletedList.Append(_productTag);
_sProdDeletedList.Append(
" ");
}
else if (_lstProducts.Count > 0)
{
_sProdList.Append(_productTag);
_sProdList.Append(
" ");
}
}
//Allow Delete as there are no child products
//int instrproductDel = _presenter.DeleteProduct(_productDeleteList);
//e.Item.OwnerTableView.Rebind();
StringBuilder _sMsgDisplay = new StringBuilder();
if (_sProdDeletedList.Length > 0)
{
//_sMsgDisplay.Append("Deleted Product List(s):");
_sMsgDisplay.Append(
"The following product(s) " + _sProdDeletedList + " have been deleted.");
}
if (_sProdList.Length > 0)
{
_sMsgDisplay.Append(
"The following product(s) " + _sProdList + " cannot be deleted.Please delete all the child product(s) of these selected product(s).");
}
RadAjaxManager1.WindowAlert(_sMsgDisplay.ToString());
}
break;
}
case "Delete":
{
//Delete single Product Logic
int _productId = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Id"]);
string _productTag =e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Tag"].ToString();
//List<InstrProduct> _productDeleteList = new List<InstrProduct>();
StringBuilder _sMsgDisplay = new StringBuilder();
//Check if the productTag has a Child Level
List<InstrProduct> _lstProducts = _presenter.GetChildProducts(_productTag);
if (_lstProducts.Count == 0)
{
//Allow Delete as there are no child products
//int instrproductDel = _presenter.DeleteProduct(_productTag, _productId);
InstrProduct _productDelete = new InstrProduct();
_productDelete.Id = _productId;
_productDelete.Tag = _productTag;
//_productDeleteList.Add(_productDelete);
//Allow Delete as there are no child products
//int instrproductDel = _presenter.DeleteProduct(_productDeleteList);
int instrproductDel = _presenter.DeleteProduct(_productDelete);
//e.Item.OwnerTableView.Rebind();
_sMsgDisplay.Append(
"The following product " + _productTag + " have been deleted.");
}
else if (_lstProducts.Count > 0)
{
_sMsgDisplay.Append(
"The following product " + _productTag + " cannot be deleted.Please delete all the child product(s) of this selected product.");
}
e.Item.OwnerTableView.Rebind();
RadAjaxManager1.WindowAlert(_sMsgDisplay.ToString());
}
break;
}
}

