Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
117 views
In RadEditor Media Manager, there are various properties for setting ViewPaths, UploadPaths and DeletePaths.

We have a situation where we have a known list of folders which a user can access. These can be loaded into the above properties.

The problem we have, its that users have access to the root folder. But if we set the above properties accordingly, by setting the root, we have no control over the sub-folders they can see.

Is there any way to limit sub-folders in Media Manager such that we can display the root (or any folder for that matter) and only certain sub-folders under it instead of all folders ?
Vessy
Telerik team
 answered on 07 Nov 2014
3 answers
145 views
Looks like if I want to export to excel I first need to bind radgrid and load to  the page and then the user does something to initiate the download.

I am trying to do the bind and export in one event. Thats why I didn't add my grid to the page, I just wanted to leverage its ability to export the data for me. I don't plan on my user ever seeing a bound radgrid.

Is something like this possible? 
public void RunReport_Click(object sender, EventArgs e)
{
    //bind a radgrid in code behind
    //export the radgrid to excel when its done binding
}

Please advise.

My data has dynamic column. I use dynamic query. The code I'm using is
       private void BuildReport(string @SpecID)
        {
            RadGrid gvTemp = new RadGrid();
            
            int db = (int)CommonFunctions.CurrentDatabase();
            DateTime StartDate = UIStartDate.SelectedDate.Value;
            DateTime EndDate = UIEndDate.SelectedDate.Value;

            using (STS32Entities ctx = new STS32Entities())
            {
                SqlConnection caConn = new SqlConnection(CaConn);
                SqlCommand caCmd = new SqlCommand("CreateDynamicQuery", caConn);
                caCmd.CommandType = CommandType.StoredProcedure;
                caCmd.Parameters.Add(new SqlParameter("@DB", db));
                //caCmd.Parameters.Add(new SqlParameter("@SeqNo", SeqNo));
                //caCmd.Parameters.Add(new SqlParameter("@DataVrsn", UIDataVersion.SelectedItem.Text));
                caCmd.Parameters.Add(new SqlParameter("@SpecID", SpecID));
                caCmd.Parameters.Add(new SqlParameter("@DateType", UIEventType.SelectedValue));
                caCmd.Parameters.Add(new SqlParameter("@StartDate", StartDate.ToShortDateString()));
                caCmd.Parameters.AddWithValue("@EndDate", EndDate.ToShortDateString());
                caCmd.Parameters.Add(new SqlParameter("@HarvestCode", UIHarvestCode.Checked));

                caConn.Open();
                SqlDataReader caRdr = caCmd.ExecuteReader();

                gvTemp.DataSource = caRdr;
                gvTemp.DataBind();
                this.Form.Controls.Add(gvTemp);
                //Download.Enabled = true;
            }
            gvTemp.ExportSettings.IgnorePaging = true;
            gvTemp.ExportSettings.FileName = "DQRecords";
            gvTemp.ExportSettings.OpenInNewWindow = true;
            gvTemp.ExportSettings.Csv.FileExtension = "xls";
            gvTemp.ExportSettings.Csv.ColumnDelimiter = GridCsvDelimiter.Comma;
            gvTemp.MasterTableView.ExportToCSV();
            gvTemp.Visible = false;
        }
Konstantin Dikov
Telerik team
 answered on 07 Nov 2014
1 answer
60 views
Hi Everyone,
I've decided to start using javascript to do some client side math instead of doing it behind code.  I started to test it out with the below page. It work but before updating RadNumericTextBox3, it throw an error message "Error: Object expected".  I look into the  browser developer tool and it throw this code "t[r](n,i)". Just to point out, Firefox and Chrome didn't display the error but when I look in the developer tool, I see the same code ""t[r](n,i)".  What am I doing wrong? How can I fix it?  PS: the radscriptmanager is in the masterpage.

<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="JavaScriptTextBox.aspx.cs" Inherits="TBSWeb.Lab.JavaScriptTextBox" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function timesValues() {
            var radTextBox1 = $find("<%= RadNumericTextBox1.ClientID %>");
            var radTextBox2 = $find("<%= RadNumericTextBox2.ClientID %>");
            var radTextBox3 = $find("<%= RadNumericTextBox3.ClientID %>");
                if (radTextBox1.get_value() != "" || radTextBox2.get_value() != "") {
                    var total = radTextBox1.get_value() * radTextBox2.get_value();
                    radTextBox3.set_value(total);
                }
            
 
        }
     
    </script>
    </telerik:RadCodeBlock>
    <telerik:RadNumericTextBox ID="RadNumericTextBox1" runat="server">
    </telerik:RadNumericTextBox>
    <telerik:RadNumericTextBox ID="RadNumericTextBox2" runat="server">
    </telerik:RadNumericTextBox>
    <telerik:RadNumericTextBox ID="RadNumericTextBox3" runat="server">
    </telerik:RadNumericTextBox>
    <telerik:RadButton ID="btnCalculate" runat="server" Text="Calculate" OnClientClicked="timesValues()">
    </telerik:RadButton>
</asp:Content>
Anthony
Top achievements
Rank 1
 answered on 07 Nov 2014
1 answer
510 views

Hi, 
i am having radgrid which i want to bind to empty datasource but not working i tried the code:  
function ClearItems1()
{
var RadGridTaskActivity = $find("<%= RadGridTaskActivity.ClientID %>").get_masterTableView();
masterTable.set_dataSource(string.Empty);
masterTable.dataBind();
}


i tried with string.empty OR [ ] OR null but nothing working.
Konstantin Dikov
Telerik team
 answered on 07 Nov 2014
1 answer
100 views
Hello Team,

I am using 2014 Q3 Asp.net controls. While using resource grouping functionality by date (vertically), the control renders misaligned cells. Please see the attached image.

I was also able to reproduce this error in a separate project. Please let me know if you want me to provide you the sample project in a support ticket.

Regards,
Hristo Valyavicharski
Telerik team
 answered on 07 Nov 2014
1 answer
46 views
If you double-click on the selected grid appreciated learn how to insert a row in another grid.

 

Konstantin Dikov
Telerik team
 answered on 07 Nov 2014
2 answers
120 views
I am trying to hide a commandItem link button based on a hiddenfiled that is in a template column inside the grid.  It keeps giving me a null value because I am assuming the grid head loads beofre the body.  So how can I hide a command item from a row in the grid.

  <CommandItemTemplate>
                                                     <asp:LinkButton ID="lnkAddDate" Text="Add Dates" CommandName="InitInsert" runat="server"></asp:LinkButton>
                                                </CommandItemTemplate>
                                                <Columns>
                                                    <telerik:GridTemplateColumn>
                                                        <ItemTemplate>
                                                            <asp:LinkButton ID="lnkDelDate" runat="server" CommandName="DelDate" CommandArgument='<%# Bind("intLeaseDateId")%>'>Delete</asp:LinkButton>
                                                            <asp:HiddenField ID="HFOccur" runat="server" Value='<%# Bind("intOcurranceId")%>' />
                                                        </ItemTemplate>
                                                    </telerik:GridTemplateColumn>
                                                    <telerik:GridEditCommandColumn HeaderText="Edit" UniqueName="EditGrid" />
                                                    <telerik:GridBoundColumn HeaderText="Start Date" DataField="dtStartDate" />
                                                    <telerik:GridBoundColumn HeaderText="End Date" DataField="dtEndDate" />
                                                </Columns>
 
 
I can find it here to hide a linkbutton that is a column in the grid, but I cannot get at the commanditem button.
 
  If (TypeOf e.Item Is GridDataItem AndAlso e.Item.OwnerTableView.Name = "LeaseDates") Then
            Dim item As GridDataItem = CType(e.Item, GridDataItem)
            Dim delete As LinkButton = DirectCast(item.FindControl("lnkDelDate"), LinkButton)
            Dim occur As HiddenField = DirectCast(item.FindControl("HFOccur"), HiddenField)
            Dim status As Integer = 2
 
            If Convert.ToInt32(occur.Value) = 5 Then
                delete.Visible = False
            End If
        End If
 
 
Atempt at the commanditem from other sources on web, but does not work.
  Protected Sub myradGrid_ItemCreated(sender As Object, e As GridItemEventArgs) Handles myradGrid.ItemCreated
        If (TypeOf e.Item Is GridCommandItem AndAlso e.Item.OwnerTableView.Name = "LeaseDates") Then
            Dim cmdItem As GridCommandItem = CType(e.Item, GridCommandItem)
            Dim btn As LinkButton = DirectCast(cmdItem.FindControl("lnkAddDate"), LinkButton)
            'Dim occur As HiddenField = DirectCast(cmdItem.FindControl("HFOccur"), HiddenField)
            'Response.Write(occur.Value)
            'Response.End()
            'If Convert.ToInt32(occur.Value) = 5 Then
            '    btn.Visible = False
            'End If
        End If
    End Sub
Eyup
Telerik team
 answered on 07 Nov 2014
1 answer
95 views
I have both of these set on my grid, e.g.

OnItemCommand="RadGrid_Application_ItemCommand" OnInsertCommand="RadGrid_Application_InsertCommand"

and on an insert, it seems both of these are being invoked, both having CommandName == RadGrid.PerformInsertCommandName (the ItemCommand is also invoked with CommandName == RadGrid.InitInsertCommandName).

For whatever reason, I was thinking that only the OnInsertCommand would be invoked for the PerformInsert. Is having both of these be invoked the expected behavior?

Eyup
Telerik team
 answered on 07 Nov 2014
1 answer
225 views
I am trying to change grouping using code behind.   I have a radgrid which depending on what the user chooses group by one element or group by two.  I attempted to do this via the code below, however when I do this the radgrid never displays any records.  I have tried to add a DataSource and Databind before and after this code but the grid never displays any records.  If I hard code the grouping on the ASPX page the records will show up although I cannot change the grouping dynamically.   Can you tell me what I am doing wrong in the code below that records would not display?

        rgPhysician.MasterTableView.GroupByExpressions.Clear()
        Dim ShowFacilities As CheckBox = ctlOptions.FindControl("cbShowFacilities")
        If ShowFacilities.Checked Then
            Dim ge1 As New Telerik.Web.UI.GridGroupByExpression
            Dim gf1 As New Telerik.Web.UI.GridGroupByField
            gf1.FieldName = "Facility"
            gf1.HeaderValueSeparator = String.Empty
            gf1.HeaderText = "Facility - "
            ge1.SelectFields.Add(gf1)
            rgPhysician.MasterTableView.GroupByExpressions.Add(ge1)

            Dim ge2 As New Telerik.Web.UI.GridGroupByExpression
            Dim gf2 As New Telerik.Web.UI.GridGroupByField
            gf2.FieldName = "Name"
            gf2.HeaderValueSeparator = String.Empty
            gf2.HeaderText = "&nbsp;"
            ge2.SelectFields.Add(gf2)
            rgPhysician.MasterTableView.GroupByExpressions.Add(ge2)
        Else
            Dim ge2 As New Telerik.Web.UI.GridGroupByExpression
            Dim gf2 As New Telerik.Web.UI.GridGroupByField
            gf2.FieldName = "Name"
            gf2.HeaderValueSeparator = String.Empty
            gf2.HeaderText = "&nbsp;"
            ge2.SelectFields.Add(gf2)
            rgPhysician.MasterTableView.GroupByExpressions.Add(ge2)
        End If   





Kostadin
Telerik team
 answered on 07 Nov 2014
1 answer
54 views
I have a radgrid, with default grouping and also has  this._RadGrid1.AllowMultiRowSelection = true;
But I am unable to select rows. Could grouping be the cause?
Eyup
Telerik team
 answered on 07 Nov 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?