Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
415 views
Dear All,

Presently, I have the scenario of File Explorer to show the specific root folders and corresponding files. Here, for the above condition, I am using RAD File Explorer. Sametime, I already implemented the sepearte permissions like View Folder, Delete Folder, create Folder, rename Folder in DB Level. The same permissions implemented for file level also.

Now, the requirement need to apply the permissions to the RAD File Explorer control to control the type of permissions based on the current user. Ex: If he has View Folder Permission he can view only the particular folder and files. The remaining folders need to be hide. The same need to apply for the file level.

Please, if anybody have the better solution.. help me..

Thanks,
Sheik Aladin
Dobromir
Telerik team
 answered on 17 Jun 2010
3 answers
268 views
Hello

Our application makes extensive use of the Web20 and Office2007 embedded skins, but I wish to make changes to these skins.
So, I followed the instructions for using themes. So, setting EnableEmbeddedSkins = false and setting the Theme property appropriately.

My procedure for getting the Web20 and Office2007 skins was to navigate to the following directories:
  1. C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q1 2010\Skins\Web20
  2. C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q1 2010\Skins\Office2007
  3. C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q1 2010\Skins

And to grab two two CSS files for the two skins and to grab the images in the two folders.
I did the recommended CSS name changes and my images are appropriately referenced.

Unfortunitely, the result from my skinning looks nothing near what the embedded skin looks like.
Now, I noticed that the controls using embedded skins were referencing images using WebResource.axd... and my controls did not have access to these files.

Please advice as to where I can download full skins from or what steps I need to take to have control over these skins.

Thanks.
Kamen Bundev
Telerik team
 answered on 17 Jun 2010
3 answers
102 views
Hi All,

How do I get the labels on the X axis to be on the top of the chart?  I tried the code below but it doesn't seem to do anything?  Is this even possible?

RadChart1.PlotArea.XAxis.Appearance.LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top;

Thanks in advance! 
Velin
Telerik team
 answered on 17 Jun 2010
1 answer
226 views
I am creating an order entry page which has a large number of items (30-50K)
On the doubleclick a user control opens up containing the part number, description, cost, etc.
is there a way to pass into (or pull up) the customer number?
I could always add it to the data source but that is increasing the size of an already large data table
the add is on a click event in the control - I could change it to trigger an Insert (adding it to the order table, not the items table)
I am working in VS2010 ASP.NET 4.0
the grid is filled through LINQ to SQL

from the main page:
<asp:Content ID="cntBody" ContentPlaceHolderID="cpHolder" Runat="Server">
    <telerik:RadScriptManager ID="rsManager" runat="server" />
    <telerik:RadCodeBlock ID="rcBlock" runat="server">
        <script type="text/javascript">
        function RowDblClick(sender, eventArgs) {
            sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
        }
        </script>
    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="raManager" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgItems">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgItems" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

the grid (from the main page)
    <telerik:RadGrid ID="rgItems" AutoGenerateColumns="False" AllowPaging="True"
            runat="server" AllowFilteringByColumn="True" AllowSorting="True" GridLines="None">
        <ClientSettings>
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView DataKeyNames="ItemID" EditMode="PopUp">
        <Columns>
            <telerik:GridBoundColumn UniqueName="ItemID" DataField="ItemID" Visible="False">
            </telerik:GridBoundColumn>
...
        </Columns>
        <EditFormSettings UserControlName="OrderItem.ascx" EditFormType="WebUserControl">
        </EditFormSettings>
        </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>
    </telerik:RadGrid>
and code behind
Partial Class Items
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim DivisionID As Integer = 3
        Dim ws As CommonFunctions
        If Page.IsPostBack Then
        Else
            ws = New CommonFunctions
            rgItems.DataSource = ws.GetItems(DivisionID)
            rgItems.DataBind()
        End If
        ws = Nothing
    End Sub

    Protected Sub rgItems_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgItems.NeedDataSource
        Dim DivisionID As Integer = 3
        Dim ws As New CommonFunctions
        rgItems.DataSource = ws.GetItems(DivisionID)
        ws = Nothing
    End Sub

End Class

the user control HTML
<%@ Control Language="VB" AutoEventWireup="false" CodeFile="OrderItem.ascx.vb" Inherits="OrderItem" %>
<table border="1" cellpadding="1" cellspacing="1" style="background-color:#CC9900;">
<tr>
<td>ItemID</td>
<td>
    <asp:Label ID="lblItemID" Text='<%# DataBinder.Eval( Container, "DataItem.ItemID") %>' runat="server" />
</td>
</tr>
...
<tr>
<td>
    <asp:Button ID="btnAddtoOrder" Text="Add to Order" CommandName="AddtoOrder" runat="server" />
</td>
<td align="right">
    <asp:Button ID="btnCancel" Text="Cancel" CommandName="Cancel" CausesValidation="false" runat="server" />
</td>
</tr>
</table>
and code behind for the user control
Imports System.Data

Partial Class OrderItem
    Inherits System.Web.UI.UserControl

    Private _dataItem As Object
    Public Property DataItem() As Object
        Get
            Return Me._dataItem
        End Get
        Set(ByVal value As Object)
            Me._dataItem = value
        End Set
    End Property
' where do I get this???????
    Private _dealerNumber As Int64
    Public Property DealerNumber() As Int64
        Get
            Return Me._dealerNumber
        End Get
        Set(ByVal value As Int64)
            Me._dealerNumber = value
        End Set
    End Property

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    End Sub

    Protected Sub btnAddtoOrder_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddtoOrder.Click
        Dim ItemID, OrderItemID As Integer

        If Page.IsValid Then
        Else
            Exit Sub
        End If

        ItemID = CInt(lblItemID.Text)

        Dim ws As New CommonFunctions
        OrderItemID  = ws.AddToOrder(DealerNumber, ItemID, etc)
        ws = Nothing
    End Sub
End Class


Rosen
Telerik team
 answered on 17 Jun 2010
1 answer
127 views
Unable to cast object of type 'System.DBNull' to type 'Telerik.Web.UI.RadTimeView'.

i got that error
Shinu
Top achievements
Rank 2
 answered on 17 Jun 2010
5 answers
200 views
Hello,

A brief explanation of what I want to do:
I'm using a Custom AdvanceEditTemplate to update employee absences. For this I need a RadGrid inside the advanceform to show absence details. Until now no problems. I'm able to populate the grid with data through a SQLDataSource. This grid records must be editable and there is where the problems start as I can't figure how to access the RadGrid (RadGrid3) update line that is nested in the AdvancedEditTemplate. In this radgrid I must have a UploadFile control to save an attachment (to filesystem) and a textbox to update a "Reason" property. I need to update this record in the absence table through an SQLDataSource which will call an SP to update these two collumns (attachment link and reason). For this I'm using the Grids UpdateCommand
event as shown below:


CodeBehind:
protected void RadGrid3_UpdateCommand(object sender, GridCommandEventArgs e)
        {
            //Insert Record in Portal Absence Tables for a Update Action
            //Properties: Reason, Attachment, Action(UPDATE),Status(1)
            GridEditableItem editedItem = e.Item as GridEditableItem;
            

            Session["lResourceAbsenceDetailID"] = editedItem["lResourceAbsenceDetailID"].Text;
            Session["Reason"] = "";
            Session["Status"] = 1;
            Session["Action"] = "UPDATE";
            Session["Attachment"] = attachment;
            SqlDataSource5.Select(DataSourceSelectArguments.Empty);
        }




ASPNET COde:
    <telerik:RadScheduler ID="RadScheduler1" OnClientAppointmentDoubleClick="OnClientAppointmentDoubleClick"
        runat="server" SelectedView="MonthView" TimelineView-UserSelectable="false" WeekView-UserSelectable="true"
        GroupingDirection="Vertical" OverflowBehavior="Expand" Skin="Outlook" DataSourceID="SqlDataSource1"
        TimelineView-HeaderDateFormat="mm-yy" StartInsertingInAdvancedForm="True" TimelineView-ColumnHeaderDateFormat="dd"
        OnAppointmentClick="RadScheduler1_AppointmentClick" OnAppointmentDataBound="RadScheduler1_AppointmentDataBound"
        OnFormCreating="RadScheduler1_FormCreating" OnFormCreated="RadScheduler1_FormCreated"
        OnAppointmentCommand="RadScheduler1_AppointmentCommand" DataEndField="EndDate"
        DataKeyField="lResourceAbsenceID" DataStartField="StartDate" DataSubjectField="Name"
        MonthView-AdaptiveRowHeight="true" OnClientAppointmentDeleting="OnClientAppointmentDeleting">
        <Localization ConfirmDeleteText="Tem a certeza que pretende eliminar esta ausência?"
            ConfirmDeleteTitle="Confirmar Eliminação" />
        <AdvancedForm Modal="true" />
        <MonthView AdaptiveRowHeight="True" />
        <AdvancedEditTemplate>
            <div class="rsAdvancedEdit" style="position: relative">
                <%-- Title bar. --%>
                <div class="rsAdvTitle">
                    <%-- The rsAdvInnerTitle element is used as a drag handle when the form is modal. --%>
                    <h1 class="rsAdvInnerTitle">
                    </h1>
                    <asp:LinkButton ID="AdvancedEditCloseButton" runat="server" CausesValidation="false"
                        CommandName="Cancel" CssClass="rsAdvEditClose" ToolTip="close"> close
                    </asp:LinkButton>
                </div>
                <div class="rsAdvContentWrapper">
                    <telerik:RadGrid ID="RadGrid3" runat="server" AutoGenerateEditColumn="True" DataSourceID="SqlDataSource9"
                        GridLines="None" OnUpdateCommand="RadGrid3_UpdateCommand" Skin="Outlook" ClientSettings-Selecting-AllowRowSelect="true">
                        <MasterTableView AutoGenerateColumns="False" DataSourceID="SqlDataSource9">
                            <RowIndicatorColumn>
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn>
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <Columns>
                                <telerik:GridBoundColumn DataField="AbsenceID" DataType="System.Int32" HeaderText="AbsenceID"
                                    ReadOnly="True" SortExpression="AbsenceID" UniqueName="AbsenceID" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridDropDownColumn DataField="AbsenceCodeID" DataSourceID="SqlDataSource8"
                                    HeaderText="Tipo Ausencia" ListTextField="Name" ListValueField="AbsenceID" ReadOnly="True"
                                    SortExpression="AbsenceCodeID" UniqueName="AbsenceCodeID">
                                </telerik:GridDropDownColumn>
                                <telerik:GridBoundColumn DataField="lResourceAbsenceDetailID" DataType="System.Int32"
                                    HeaderText="lResourceAbsenceDetailID" ReadOnly="True" SortExpression="lResourceAbsenceDetailID"
                                    UniqueName="lResourceAbsenceDetailID" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="lResourceAbsenceID" DataType="System.Int32" HeaderText="lResourceAbsenceID"
                                    ReadOnly="True" SortExpression="lResourceAbsenceID" UniqueName="lResourceAbsenceID"
                                    Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ResourceID" DataType="System.Int32" HeaderText="ResourceID"
                                    ReadOnly="True" SortExpression="ResourceID" UniqueName="ResourceID" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Hours" DataType="System.Int64" HeaderText="Hours"
                                    ReadOnly="True" SortExpression="Hours" UniqueName="Hours" Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ScheduleDetailID" DataType="System.Int32" HeaderText="ScheduleDetailID"
                                    ReadOnly="True" SortExpression="ScheduleDetailID" UniqueName="ScheduleDetailID"
                                    Visible="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="starttime" DataType="System.TimeSpan" HeaderText="Hora Inicio"
                                    ReadOnly="True" SortExpression="starttime" UniqueName="starttime">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="endtime" DataType="System.TimeSpan" HeaderText="Hora Fim"
                                    ReadOnly="True" SortExpression="endtime" UniqueName="endtime">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Date" DataType="System.DateTime" HeaderText="Data"
                                    ReadOnly="True" SortExpression="Date" UniqueName="Date">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Reason" HeaderText="Motivo" UniqueName="Reason">
                                </telerik:GridBoundColumn>
                                <telerik:GridAttachmentColumn FileNameTextField="Attachment" HeaderText="Anexo" UniqueName="Attachment">
                                </telerik:GridAttachmentColumn>
                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" />
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                    <br />
                    <div>
                        <asp:ImageButton ID="btn_AllUsers" runat="server" ImageUrl="~/images/delete.gif"
                            CommandName="DeleteAbsence" />
                        <asp:LinkButton ID="lBtn_DeleteAbsence" Text="Eliminar Tudo" CssClass="SubHead" runat="server"
                            CommandName="DeleteAbsence_" />
                        <br />
                        <asp:Label ID="pl_DeleteRequestMessage" CssClass="SuccessMessage" runat="server"
                            Visible="false" />
                    </div>
                    <asp:Panel ID="ButtonsPanel" runat="server" CssClass="rsAdvancedSubmitArea">
                        <div class="rsAdvButtonWrapper">
                            <%--<asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update" CssClass="rsAdvEditSave"> <span>Salvar</span>
                            </asp:LinkButton>--%>
                            <asp:LinkButton ID="CancelButton" runat="server" CausesValidation="false" CommandName="Cancel"
                                CssClass="rsAdvEditCancel"> <span>VOLTAR</span>
                            </asp:LinkButton>
                        </div>
                    </asp:Panel>
                </div>
            </div>
        </AdvancedEditTemplate>


....but it's not working as I can't get the Grid row that I'm updating through (editedItem["lResourceAbsenceDetailID"].Text;). Another problem is that I'm not able to debug this. Can someone please tell me what I must do to make this work. I would very much apreciate any help.

Cheers,
Pedro



Peter
Telerik team
 answered on 17 Jun 2010
1 answer
62 views
Hi Team,

Changing SpecialDays style or templateID are well documented, but could you explain how to change SpecialDays item content adding extra markups or some content at runtime server side (client side only get)coded?. I searching to add more information inside the item.
Exist others ways to add contents in normal items(not special days) near date?.

Thanks for your tip. Romi
Maria Ilieva
Telerik team
 answered on 17 Jun 2010
6 answers
201 views
RadEditor lite deployed and activated on my wss 3.0 site but not showing as default list editor; wss standard editor shows instead. I've checked several threads online and I believe I've deployed the solution correctly and both the 

Use RadEditor to edit List Items

and 

Use RadEditor to edit List Items in Internet Explorer as well

site features showing as activated on the site settings. I've done an iisreset 3 times now; no luck.

I was wondering about pre-reqs. Is ajax required for the lite editor?

Anything else obvious I may be missing that I can check?

Many thanx in advance!!
catherineball
Top achievements
Rank 1
 answered on 17 Jun 2010
5 answers
389 views
I'm using a FileExplorer that displays image files.  When the user selects a file I need to postback to do some logic.  So I have the following function wired up to the OnClientItemSelected event.

        function OnClientItemSelected(sender, args) 
        { 
            var imageSrc = args.get_path(); 
 
            if (imageSrc.match(/\.(gif|jpg|png)$/gi)) 
            { 
                var filename = imageSrc.substring(imageSrc.lastIndexOf('/') + 1); 
                __doPostBack("rfeCharts", filename); 
            } 
        } 

After the postback, the file is no longer selected in the control.  I've tried reselecting the file on the server side with .InitialPath and on the client side using the following:
        function OnClientLoad(oExplorer, args) 
        { 
            var hdChartID = $get("<%=hdChartID.ClientID %>"); 
            var oGrid = oExplorer.get_grid(); 
            var dataRows = oGrid.MasterTableView.get_dataItems(); 
             
            for(var i = 0; i < dataRows.length; i++) 
            { 
                if(dataRows[i].get_dataItem()) 
                { 
                    if(dataRows[i].get_dataItem().Name == hdChartID.value) 
                        oGrid.MasterTableView.selectItem(oGrid.MasterTableView.get_dataItems()[i].get_element()); 
                } 
            } 
        } 

And these methods both fire the OnClientItemSelected event again which causes an infinite postback loop.

So how can I persist the selected item through a postback?  Or is there another suggestion?




Fiko
Telerik team
 answered on 17 Jun 2010
8 answers
309 views
I am trying to use the self-referencing hierarchy functionality of the grid but can't seem to get it to work properly. I even tried copying the code directly from the tutorial specified here verbatim into a new page and I continually get the same error: "No property or field 'ParentID' exists in type 'DataRowView'."

My application has the following grid definition:

    <telerik:RadGrid ID="RadGrid2" runat="server" Skin="" Width"97%" OnNeedDataSource"RadGrid2_NeedDataSource" GridLines="None" ShowHeader="False">  
        <MasterTableView HierarchyDefaultExpanded="True" HierarchyLoadMode="Client" DataKeyNames"NETT_ID,NETT_IS_ID" Width="100%" AutoGenerateColumns="False">  
        <SelfHierarchySettings ParentKeyName="NETT_IS_ID" KeyName="NETT_ID" MaximumDepth="0" /> 
        <Columns> 
            <telerik:GridBoundColumn HeaderText="NETT_ID" DataField="NETT_ID" /> 
            <telerik:GridBoundColumn HeaderText="NETT_IS_ID" DataField="NETT_IS_ID" /> 
            <telerik:GridBoundColumn HeaderText="Intermediate Stock" DataField="NETT_PRODUCT" /> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid>  

When I run it against my data source, the grid binds great and even has the hierarchy as I would expect with one exception - ALL records are displayed as if they are parent records in addition to the one record that should be a parent record (which has all records again as children). I need to get rid of all the "top elements" with the exception of the one that is really supposed to be the parent. In the future multiple top-level parent elements will exist (all with a NETT_IS_ID value of 0), but currently only one does.

I tried using FilterExpressions, but even when I use the sample code provided from the Knowledge Base, it doesn't run. It just tells me the column NETT_IS_ID doesn't exist in the dataview, even though I can bind to it directly and it does in fact exist.

In case it helps, here is my code-behind:
        protected void Page_Load(object sender, EventArgs e)  
        {  
            site mstr = (site)this.Master;  
            mstr.PageHeader = "Intermediate Stock";  
 
            this.PreRenderComplete += new EventHandler(Page_PreRenderComplete);  
            //this.BindData();  
        }  
 
        DataTable BindData()  
        {  
 
            DataSet ds = new DataSet();  
 
            using (OracleConnection conn = new OracleConnection(ConfigurationManager.ConnectionStrings["IntermediateStock"].ConnectionString))  
            {  
 
                using (OracleCommand cm = new OracleCommand())  
                {  
 
                    cm.Connection = conn;  
                    cm.CommandText = "IS_NETT.GET_PRODUCT_TREE";  
                    cm.CommandType = CommandType.StoredProcedure;  
 
                    OracleParameter param = new OracleParameter();  
                    param.Direction = ParameterDirection.Output;  
                    param.ParameterName = "IO_CURSOR";  
                    param.OracleType = OracleType.Cursor;  
 
                    cm.Parameters.Add(param);  
 
                    using (OracleDataAdapter da = new OracleDataAdapter(cm))  
                    {  
                        //da.TableMappings.Add("Table", "ISResults");  
                        da.Fill(ds, "Table");  
                    }  
 
                }  
 
            }  
 
            DataColumn[] keys = new DataColumn[1];  
            keys[0] = ds.Tables[0].Columns["NETT_ID"];  
 
            ds.Tables[0].PrimaryKey = keys;  
 
            return ds.Tables[0];  
 
        }  
 
        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)  
        {  
            this.RadGrid1.DataSource = this.BindData();  
        }  
 
        protected void RadGrid2_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)  
        {  
            this.RadGrid2.DataSource = this.BindData();  
        }  
 
        public void Page_PreRenderComplete(object sender, EventArgs e)  
        {  
            HideExpandColumnRecursive(RadGrid1.MasterTableView);  
            HideExpandColumnRecursive(RadGrid2.MasterTableView);  
        }  
        public void HideExpandColumnRecursive(GridTableView tableView)  
        {  
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);  
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)  
            {  
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)  
                {  
                    if (nestedView.Items.Count == 0)  
                    {  
                        TableCell cell = nestedView.ParentItem["ExpandColumn"];  
                        cell.Controls[0].Visible = false;  
                        nestedViewItem.Visible = false;  
                    }  
                    if (nestedView.HasDetailTables)  
                    {  
                        HideExpandColumnRecursive(nestedView);  
                    }  
                }  
            }  
        }   
    }  
}  
 

Any suggestions?
Yavor
Telerik team
 answered on 17 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?