Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
58 views
Hi All,
          I have two detail tables in my Rad grid which renders three child grids on UI  with expand and collapse button. Now When collapse the last child grid then upper two child grid's collapse button image changes in to expand button image . I had set  HierarchyLoadMode="ServerOnDemand"  in <masterTableview>  . If set this to "Client " it works fine but the grid does not get refreshed after deleting record from the grid . Please  Let me know what am  i doing wrong 


   <telerik:RadGrid ID="RadGrid" OnPreRender="RadGrid_PreRender" OnNeedDataSource="RadGrid_NeedDataSource" OnItemCommand="RadGrid_ItemCommand1"
                                    runat="server" Width="99.4%" OnDetailTableDataBind="RadGrid_DetailTableDataBind"
                                    OnItemDataBound="RadGrid_ItemDataBound" OnItemCreated="RadGrid_ItemCreated"
                                    OnPageIndexChanged="RadGrid_PageIndexChanged" >
                                    <ClientSettings>
                                        <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="true"
                                            ClipCellContentOnResize="true" />
                                    </ClientSettings>
                                    <MasterTableView  HierarchyLoadMode="ServerOnDemand"
                                        HierarchyDefaultExpanded="false" TableLayout="Fixed" CommandItemDisplay="Top">
                                           <Columns>
                                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="Text1" HeaderButtonType="TextButton"
                                                DataField="VendorName">
                                                <%-- Defect# 12711--%>
                                            </telerik:GridBoundColumn>
                                        </Columns>
                                        <DetailTables>
                                            <telerik:GridTableView DataKeyNames="KeyName" GridLines="None" HierarchyLoadMode="Client" HierarchyDefaultExpanded="true">
                                                <PagerStyle Visible="false" />
                                                <ParentTableRelation>
                                                    <telerik:GridRelationFields  MasterKeyField="Name" />
                                                </ParentTableRelation>
                                                <Columns>
                                                    <telerik:GridBoundColumn  HeaderText="text"
                                                        UniqueName="FuelImportConfigurationDesc">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Name2" HeaderText="Name2" UniqueName="FuelVendor">
                                                        <%-- Defect# 12711--%>
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="FixedColumn" HeaderText="Fixed Column" UniqueName="FixedColumn">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Delimiter" HeaderText="Delimiter" UniqueName="Delimiter">
                                                    </telerik:GridBoundColumn>
                                                    <telerik:GridBoundColumn DataField="Name3" HeaderText="Name3"
                                                        UniqueName="DisbursementType">
                                                    </telerik:GridBoundColumn>
                                                </Columns>
                                                <DetailTables>
                                                    <telerik:GridTableView DataKeyNames="Name4" Width="100%" GridLines="None"
                                                        HierarchyLoadMode="Client" AllowCustomPaging="true">
                                                        <ParentTableRelation>
                                                            <telerik:GridRelationFields DetailKeyField="Name5" MasterKeyField="Name5" />
                                                        </ParentTableRelation>
                                                        <Columns>
                                                            <telerik:GridTemplateColumn UniqueName="SelectItemCheckBoxColumn" Resizable="false" Reorderable="false">
                                                                <ItemTemplate>
                                                                    <asp:CheckBox ID="SelectItemCheckBox" runat="server" onclick="return CheckItem(this);" />
                                                                </ItemTemplate>
                                                                <HeaderTemplate>
                                                                    <asp:CheckBox ID="SelectHeaderCheckBox" runat="server" onclick="CheckAll(this);" />
                                                                </HeaderTemplate>
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridTemplateColumn HeaderText="Action" UniqueName="TemplateColumn" Resizable="false" Reorderable="false">
                                                                <ItemTemplate>
                                                                    <asp:HyperLink ID="EditHyperLink" runat="server" Text="Edit" SkinID="SmallHyperLink"></asp:HyperLink>
                                                                </ItemTemplate>
                                                                <HeaderStyle Width="5%" />
                                                            </telerik:GridTemplateColumn>
                                                            <telerik:GridBoundColumn DataField="Name6" HeaderText="Name5"
                                                                UniqueName="Name6" SortExpression="Name6">
                                                                <HeaderStyle Width="10%" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Name7" HeaderText="Asset Number" UniqueName="Name7"
                                                                SortExpression="Name7">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Name8" HeaderText="Name8" UniqueName="Name8"
                                                                SortExpression="Name8">
                                                                <HeaderStyle Width="10%" />
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridBoundColumn DataField="Name9" HeaderText="Name9" UniqueName="Name9"
                                                                SortExpression="Name9">
                                                                <HeaderStyle Width="10%" />
                                                            </telerik:GridBoundColumn>
                                                           <telerik:GridBoundColumn DataField="ErrorDescription" HeaderText="Error Description"
                                                                UniqueName="ErrorDescription" SortExpression="ErrorDescription">
                                                                <HeaderStyle Width="20%" />
                                                            </telerik:GridBoundColumn>
                                                        </Columns>
                                                    </telerik:GridTableView>
                                                </DetailTables>
                                            </telerik:GridTableView>
                                        </DetailTables>
                                    </MasterTableView>
                                </telerik:RadGrid>



here is the code behind
   protected void Page_Init(object sender, EventArgs e)
    {
       
    } 
    protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
    {
       
    }

    protected void RadGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
    {
       
    }

    protected void RadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
       
    }
    protected void RadGrid_PreRender(object sender, EventArgs e)
    {
        Boolean hasRecords = false;
        if (RadGrid.MasterTableView.Items.Count > 0)
        {
            foreach (GridDataItem dataItem in RadGrid.MasterTableView.Items)
            {

                foreach (GridDataItem nestedDataItem in dataItem.ChildItem.NestedTableViews[0].Items)
                {

                    if (!hasRecords && nestedDataItem.ChildItem.NestedTableViews[0].Items.Count > 0)
                    {
                        hasRecords = true;
                        break;
                    }
                }
                if (hasRecords)
                    break;

            }
        }

        ClearSelectedLinkButton.Enabled = hasRecords;
    }    
    
    protected void Page_PreRender(object sender, System.EventArgs e)
    {
        GridItem commandItem = RadGrid.MasterTableView.GetItems(GridItemType.CommandItem)[0];
        ImageButton exportToExcelImageButton = commandItem.FindControl("ExportToExcelImageButton") as ImageButton;
        Boolean isGridHasData = RadGrid.Items.Count > 0;
        if (exportToExcelImageButton != null)
        {
            exportToExcelImageButton.Enabled = isGridHasData;
            if (exportToExcelImageButton.Enabled)
            {
                exportToExcelImageButton.Attributes.Add("onclick", String.Format("DisableAjax(\"{0}\", \"\"); return false;", exportToExcelImageButton.UniqueID));
                exportToExcelImageButton.Style.Add(StringResources.CssCursorKey, StringResources.CssCursorValue);
            }
        }
    }
   

    protected void RadGrid_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            if (objFasterCache[String.Format("Vendor{0}", _guid)] != null)
            {
                if (Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["Name1"]) == (Int32)objFasterCache[String.Format("Name{0}", _guid)])
                    e.Item.OwnerTableView.HierarchyDefaultExpanded = true;
                else
                    e.Item.OwnerTableView.HierarchyDefaultExpanded = false;
            }
        }
    }

Thanks

  
Shubham
Top achievements
Rank 1
 answered on 21 Jan 2014
3 answers
214 views
I'm tring to create simple RadOrgChart page. And I have to bind it by DataTable. I did, but it doesnt work.

My Telerik version is 2011.3.1115.40.

Here is my code;
<%@ Page Title="" Language="C#" MasterPageFile="~/Controls/MasterPages/User.master" Theme="Default" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Sections_OrgChart_Default" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
 
<telerik:RadOrgChart runat="server" ID="RadOrgChart1" ></telerik:RadOrgChart>
 
</asp:Content>

And my Cs codes,
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Getron.AAM;
using Getron.AAM.EntityManagement;
using Getron.Core.Base.Objects;
using System.Data;
 
public partial class Sections_OrgChart_Default : EntityProtectedPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        OrgSchema osch = new OrgSchema();
        QueryEntity qent = new QueryEntity();
        qent.QueryEntityType = Getron.Core.Enums.EQueryEntityType.WhereCondition;
        qent.Query = "SupervisorId=@SupervisorId";
        Getron.DBInterface.Parameter p0 = new Getron.DBInterface.Parameter("@SupervisorId", ParameterDirection.Input, DbType.Int64, 0);
        p0.Value = 23;
        qent.Parameters.Add(p0);
 
        DataTable dt = new DataTable();
        dt = osch.GetCustomViewAll("OrgSchemaAllData", new List<string>() { "SystemUserIntCode", "SystemUserName", "SuperVisorId" }, qent);
 
        RadOrgChart1.DataTextField = "SystemUserName";
        RadOrgChart1.DataFieldID = "SystemUserIntCode";
        RadOrgChart1.DataFieldParentID = "SupervisorId";
 
        RadOrgChart1.DataSource = dt;
        RadOrgChart1.DataBind();
    }
}

And I attached my DataTable result panel picture.(dt object preview)
Shinu
Top achievements
Rank 2
 answered on 21 Jan 2014
3 answers
102 views
I have a grid on a page that displays some basic information about an item, such as item # and description.  I need to be able to allow my users to enter detail information about any item they choose then update a database with those values.  Presently I'm doing this by entering all of my detail fields as textboxes in an ItemTemplate.  Once the user is done entering information they hit a submit button that goes through every row in the table and checks for updates and the updates the database.  While this works, it is very inefficient and actually does fail to work when my server has lots of traffic.  It simply times out.  

For my scenario, what is the proper way to do this?

Thanks.
Viktor Tachev
Telerik team
 answered on 21 Jan 2014
1 answer
350 views
Type 'Telerik.Web.UI.RadListBoxItemCollection' in Assembly 'Telerik.Web.UI, Version=2013.2.717.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable.
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.Runtime.Serialization.SerializationException: Type 'Telerik.Web.UI.RadListBoxItemCollection' in Assembly 'Telerik.Web.UI, Version=2013.2.717.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable.
 
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:
 
 
[SerializationException: Type 'Telerik.Web.UI.RadListBoxItemCollection' in Assembly 'Telerik.Web.UI, Version=2013.2.717.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable.]
   System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) +9476053
   System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) +247
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() +160
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) +491
   System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Object obj, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, ObjectWriter objectWriter, SerializationBinder binder) +54
   System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck) +542
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck) +133
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph) +13
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3113
 
[ArgumentException: Error serializing value 'Telerik.Web.UI.RadListBoxItemCollection' of type 'Telerik.Web.UI.RadListBoxItemCollection.']
   System.Web.UI.ObjectStateFormatter.SerializeValue(SerializerBinaryWriter writer, Object value) +3428
   System.Web.UI.ObjectStateFormatter.Serialize(Stream outputStream, Object stateGraph) +141
   System.Web.UI.ObjectStateFormatter.Serialize(Object stateGraph) +57
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Serialize(Object state) +4
   System.Web.UI.Util.SerializeWithAssert(IStateFormatter formatter, Object stateGraph) +37
   System.Web.UI.HiddenFieldPageStatePersister.Save() +79
   System.Web.UI.Page.SavePageStateToPersistenceMedium(Object state) +108
   System.Web.UI.Page.SaveAllState() +315
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2839
 
  
 
 
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1016
Plamen
Telerik team
 answered on 21 Jan 2014
3 answers
111 views

Hi, i have Telerik version  Q3 2012 , Oracle DB 10, VS 2005.

I try in all the way to bind data to RadPivot but no way, nothing happens. I tried with ObjectDataSource and with Advanced Data...but i failed.

Do i need a specific DDL ? or another version of Telerik ?

Anyway give a look to what i produce and tell me please where is the mistake.



<telerik:RadPivotGrid runat="server" ID="RadPivotGrid1" AllowFiltering="true"

AllowPaging = "true"

Width="800px" Height="400px"

AllowSorting="true"

ShowFilterHeaderZone="true"

OnNeedDataSource="RadPivotGrid1_NeedDataSource" >

<ClientSettings EnableFieldsDragDrop="true">

<Scrolling AllowVerticalScroll="true"></Scrolling>

</ClientSettings>

<Fields>

<telerik:PivotGridRowField DataField="attivita">

</telerik:PivotGridRowField>

<telerik:PivotGridColumnField DataField="liv_auto">

</telerik:PivotGridColumnField>

<telerik:PivotGridAggregateField DataField="q_ta" Aggregate="Sum">

</telerik:PivotGridAggregateField>

</Fields>

</telerik:RadPivotGrid>


In vb file :



Protected Sub RadPivotGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.PivotGridNeedDataSourceEventArgs) Handles RadPivotGrid1.NeedDataSource

       

TryCast(sender, RadPivotGrid).DataSource = GetDataTable("SELECT * FROM lbrms_libretto_vw where matri=17720")

End Sub


Public Function GetDataTable(ByVal query As String) As DataTable

Dim ConnString As [String] = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString

Dim conn As New OracleConnection(ConnString)

Dim adapter As New OracleDataAdapter()

adapter.SelectCommand = New OracleCommand(query, conn)

Dim myDataTable As New DataTable()

conn.Open()

Try

adapter.Fill(myDataTable)

Finally

conn.Close()

End Try

Return myDataTable

End Function


NeedDataSource fires and the DataTable contains data. But  Pivot show  no data.

I guess maybe the structure of my Oracle Table is not good for Pivot ?



ID     Activity    Level_Activity  Quantity

--      ---------     ------------------- -----------

1       A             High                  20

2       A             Low                   10

3       B             High                   12



and so on.....



SomeOne can help me  ?



Thanks Maurizio



Ghezzo
Top achievements
Rank 1
 answered on 21 Jan 2014
8 answers
342 views
I'm looking at the demo example of the radrotator and I can't get it to work. What I want is to scroll between two or more image that I know the urls of.

My code:

<telerik:RadRotator ID="RadRotator1" runat="server" Width="580px" ItemWidth="300"
                Height="250px" ItemHeight="220" ScrollDuration="500" FrameDuration="2000"
                PauseOnMouseOver="false">              
                <ItemTemplate>
                    <asp:Image ID="Image1" runat="server" ImageUrl="http:/..1.jpg." />
                </ItemTemplate>
<ItemTemplate>
                    <asp:Image ID="Image2" runat="server" ImageUrl="http:/..2.jpg" />
                </ItemTemplate>
    </telerik:RadRotator>



What am I missing here? Nothing is visible.
        
Shinu
Top achievements
Rank 2
 answered on 21 Jan 2014
1 answer
165 views
Hai 
  i need sample code for grid view filter template like this
http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/filtering/filter-templates/defaultvb.aspx

first grid view sample but biding data from server side not in code bhind,bcz i am use Access db,so db path is always change.i need same functionality with filter opation and need one more column with checkbox,after check box need to delete checked box.
Shinu
Top achievements
Rank 2
 answered on 21 Jan 2014
1 answer
97 views
Hi,
       The below mention is the radrotator controls which I have created.  
Javascript

<script type=
"text/javascript">
    function OnClientButtonClick(sender, args) {
//        debugger;
        var currentIndex = sender.get_currentItem().get_index();
        var count = sender.get_items().length;
        var frames = Math.ceil(count / 3);
        var tot = 1;
            if (currentIndex % 3 == 0) {
                tot = 2 + (sender.get_currentItem().get_index() / 3);
            }
            else if (currentIndex == 0)
                tot = 1;
        var com = tot + '/' + frames;
        document.getElementById('<%= this.Label1.ClientID %>').innerHTML = com;
    }
</script>
<telerik:RadRotator ID="ImageStrip_RadRotator" InitialItemIndex="0" runat="server" RotatorType="CoverFlowButtons" >
                    <ItemTemplate>
                        <telerik:RadBinaryImage ID="RadBinaryImage1" CssClass="itemTemplate" runat="server" DataValue='<%# Eval("Photo") == DBNull.Value? new System.Byte[0]: Eval("Photo") %>'
                            AutoAdjustImageControlSize="false" />
                    </ItemTemplate>
                    <ControlButtons OnClientButtonClick="OnClientButtonClick" />
                </telerik:RadRotator>

   I have given the rotator dimensions and rotator type in .cs file,which is working fine. The rotator shows 3 images per frame.Suppose if there are 7 images then 3 frames will be shown. I'm getting the number of frames from "Var Frames" in the script.
  What I want is that how to find the current frame if i move the left/right button in rotator  ? I have attached a screenshot also.
If you are not able to find out the current frame, can you tell me this with respect to number of images in the rotator and the current image in focus. I'm looking for a javascript.


Regards
Rahul
Slav
Telerik team
 answered on 21 Jan 2014
4 answers
976 views
Hello,
I have a requirement as follows,
I need to disable rad Grid Edit button If I am click on Edit and It needs to be enable when update/cancel click. Please find the attached screen shot.
Here I am using GridEditCommandColumn and EditFormSettings for edit form. 
Please give your valuable suggestions.

Regards,
Prasad.
Princy
Top achievements
Rank 2
 answered on 21 Jan 2014
10 answers
612 views

Hello,

I've seen many threads about this problem but none of the solutions provided seems to be working for me.

I'm using radEditor and the upload button (and the others) are disabled in the Image Manager on the production server. It's, working fine on my development server though.

It's the first time I've got this problem and I've used the editor in other applications.

To make sure the problem is not due to some Javascript or other codes, I've created a simple .aspx page (not secured or anything) with just this HTML and code-behind :

 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="editor.aspx.vb" Inherits="editor" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>Test</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1"></telerik:RadScriptManager>
         <telerik:RadEditor ID="fTest" Width="960px" ToolsFile="~/editor/ToolsFile.xml" ValidationGroup="MyValidationGroup" Runat="server">
            <Tools>
                <telerik:EditorToolGroup Tag="FileManagers">
                    <telerik:EditorTool Name="ImageManager" />
                </telerik:EditorToolGroup>
            </Tools>
        </telerik:RadEditor>
    </div>
    </form>
</body>
</html>

Dim nomRepGeneral As String = "~/uploaded/test"
fTest.ImageManager.ViewPaths = New String() {nomRepGeneral}
fTest.ImageManager.UploadPaths = New String() {nomRepGeneral}
fTest.ImageManager.DeletePaths = New String() {nomRepGeneral}


I've used the test code to make sure the rights are set correctly on the folder (here).

Any idea ?

Thank you

venkat
Top achievements
Rank 1
 answered on 21 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?