Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
92 views
I would like to display items a grid as shown below. Each record has several fields which would go in the first row. The record also have a summary which will go in the next row and span all columns. Is this possible in the RadGrid? I know I can do it with an HTML table, but I would like to take advantage of the extra features of a control.


URL                                   Date          FileType
abcd.com                          3/3/2008     .pdf              
summary blah blah blah blah blah blah blah
blah blah blah blah blah a sdfw qwer qwer wqer

cdes.com                          3/5/2004      .doc
summary blah blah blah blah blah blah blah
blah blah blah blah blah blah blah blah
Daniel
Telerik team
 answered on 16 Dec 2008
1 answer
104 views
Hi 

    Am using Rad upload control within updatepanel, and I use Postbacktrigger to do complete postback of the page whenever the file is uploaded. I get "this.$events is null or not an object" javascript error in jquery.js file after the file is saved in server. can you pls help this is uregent for me.

Thanks & Regards
Pandiyan
Atanas Korchev
Telerik team
 answered on 16 Dec 2008
2 answers
275 views
I upgraded my code from Q2 to Q3 and I have a radsplitter, and I get this error :
SplitterItemsCollection must contain SplitterItem objects

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  

It works fine in Q2

Here is my code:

 <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> 

Laura
Top achievements
Rank 1
 answered on 16 Dec 2008
2 answers
107 views
Hello everyone!
I have a RadMenu in my application and it´s items are created dynamically.
According with the item that the user chooses in a RadGrid, an item (or subitem) in the menu is removed.
I was reading the example in this site that shows how to remove an item of a RadMenu, but the problem is that the item has to be removed in the code Behind (c#).
Did I explain well?
How can I remove the subitems? I tried, but I couldn't.
Thanks a lot.
Evellyn
Top achievements
Rank 1
 answered on 16 Dec 2008
2 answers
118 views
I am using GridEditMode.PopUp to do my editing of grid items however I need to change the width of the popup window so that I can have a RadEditor in the window without it looking all "squished" together. How can I update the properties of the window that pops up? I have tried putting a RadWindowManager on the page and setting the Width property, but that has no effect (same with all the other properties set in the RadWindowManager).

Thanks!
jfkrueger
Top achievements
Rank 1
 answered on 16 Dec 2008
3 answers
196 views
Hi, after updating to the last version, this client code stop fonctionning:

 

for (var i = 0; i < grid.MasterTableView.SelectedRows.length; i++)

 

{
    ... 

 

 

 

}

i got a not defined error on the MasterTableView
I try this:

for

 

(var i = 0; i < grid.get_masterTableView().SelectedRows.length; i++)

 

 

{
    ... 

 now i got this objet do not have this properties.

any suggestion? Thanks

 

Iana Tsolova
Telerik team
 answered on 16 Dec 2008
14 answers
404 views
HI,

Iam creating a Hierarchial Grid.The MasterTableview is defined at design time.But the hierachy detail tables are created programatically.

Below are my issues:

I have the commanditemTemplate set for insert/update/delete opetaions.Also have the GridButtonCoumn and GridClientSelectColumn

First time when i choose the items without expandong the grid and try to click the delete from the commanditemtemplate it works

But when i expand the grid and try to use the CommanditemTemplate for delte it doesn't work ..the Deletecommand is not getting triggreed.

Also when i try to click the select all checkbox of the clientselectcolumn in the child grids it throws a null reference javascriot error

Below is my clientsettings for the grid

<

ClientSettings AllowKeyboardNavigation="True"

 

 

EnableRowHoverStyle="True">

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 


but when i expand the grid the enable hoverstyle is gone..

I remember saying like telerik has issues if the grid ID being named with an Underscore.I have chnaged it..but there some columns with their uniquenmaes starting with an underscore.

Below is the code for the Grid:

ASPX:
-------

<

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>

 

 

&nbsp;

 

 

<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>

 

 

&nbsp;

 

 

<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>

 

 

&nbsp;

 

 

<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>

 

 

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;

 

 

<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>

 




ASPX.CS
------------

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;

 

 

}

 

}

Jason Maronge
Top achievements
Rank 1
 answered on 16 Dec 2008
5 answers
343 views
Hi,

I have two treeview controls, one is the source and another is the destination.
I populate the source treeview control dynamically only on first page load i.e not on Postback, like

If Not IsPostback() then

PopulateSourceTreeview()    ' Private subroutine to populate treeview               dynamically.

End If

But what's happening is once I drag a node from source to destination, some nodes in Source treeview is getting duplicated, i.e it's again being added, especially the ones that have child node. But the one which don't have child nodes are not getting duplicated.

thnx
Mallverkstan
Top achievements
Rank 2
 answered on 16 Dec 2008
3 answers
98 views
Hi All,

I want to show "add new record" and "refresh" hyper links in grid header and footer, so what property will changed to show these links??

Regards
Vlad
Telerik team
 answered on 16 Dec 2008
1 answer
115 views
My scollbar appears after the grid is loaded. I add my columns on code behind. When the page is loaded, the grid first display in full size, then it's rezised to 150px height with scollbar. Do anyone now how i can fix this?

Here is my code:

<telerik:RadGrid ID="gridLog" Skin="Outlook" EnableEmbeddedSkins="false" Height="150px" AllowSorting="true" AutoGenerateColumns="false" ImagesPath="Css\Grid" runat="server">                       
                        <ClientSettings>
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                        </ClientSettings>                        
</telerik:RadGrid>

Private Sub BuildLogGrid()
        Dim oDataCol As GridBoundColumn

        oDataCol = New GridBoundColumn
        gridLog.Columns.Add(oDataCol)
        oDataCol.DataField = "logId"
        oDataCol.HeaderText = "Tidspunkt"

oDataCol = New GridBoundColumn
        gridLog.Columns.Add(oDataCol)
        oDataCol.DataField = "logName"
        oDataCol.HeaderText = "Name"
        oDataCol.HeaderStyle.Width = "750"
        oDataCol.ItemStyle.Width = "750"     

        'set the keys for the datagrid
        Dim keys() As String = {"logId"}
        gridLog.MasterTableView.ClientDataKeyNames = keys
        gridLog.MasterTableView.NoMasterRecordsText = ""
    End Sub
Dimo
Telerik team
 answered on 16 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?