Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
157 views
Hi,

I'm having some issue with export selected columns and I hope you can help me with it.

On my page I have a RadGrid_Parent that uses an sqldatasource with autogeneratecolumns='false'
inside the RadGrid_Parent I'm making use of the NestedViewTemplate to expand or collapse the selected row.

When the RadGrid_Parent expands it opens another RadGrid_Child AutoGeneratedColumns='true' EnableHeaderContextMenu='true' that uses needdatasource advanced databinding.

The problem I'm having is when i try to export the nestedview RadGrid_Child that uses the advanced data binding it exports all the columns it ignores any column I hide using the EnableHeaderContextMenu

I also tried to make the columns display and visible false in the ItemCommand section but it still picks up columns as display all.

Example of the ItemCommand code as mentioned in sentence above.
 
if (e.CommandName == Telerik.Web.UI.RadGrid.ExportToExcelCommandName ||
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToWordCommandName ||
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToCsvCommandName ||
            e.CommandName == Telerik.Web.UI.RadGrid.ExportToPdfCommandName)
        {
            foreach (GridColumn col in RadGridChild.MasterTableView.AutoGeneratedColumns)
            {
                if (!col.Display)
                {
                   col.Display = false;
                    col.Visible = false;
                }
            }
          }

Any help would be greatly appreciated.

Kind Regards
Princy
Top achievements
Rank 2
 answered on 10 Sep 2013
7 answers
201 views
I have a custom process I'm using the RadProgressArea for.  I'd like to customize the text shown on the RadProgressArea so it doesn't say anything about files or file upload similar to the demo page (http://demos.telerik.com/aspnet-ajax/progressarea/examples/customprogress/defaultcs.aspx).  I'm following the steps on this page, http://www.telerik.com/help/aspnet-ajax/progressarea-customprogress.html, but the message under the progress bar says "Uploaded files" and the message that is set using CurrentOperationText has "Uploading file" before the message.  How can I get rid of "Uploading file:" in the CurrentOperationText message?  See attached for what I'm seeing.


Plamen
Telerik team
 answered on 10 Sep 2013
3 answers
109 views

I developed a resource booking system expanding on the Telerik Customized Edit Form Example.     I have released this on Codeplex for anyone to have a look at and improve.  It includes a reporting project.  I'm new to the whole complex thing so I hope that is setup ok.  Its in Vb.net but there is not really a lot of code.

https://resourcebooking.codeplex.com/
Plamen
Telerik team
 answered on 10 Sep 2013
1 answer
117 views
Hi..
I am using GridClientSelectColumn, but the checkbox values doesn't persist when paging..
Please can you show how to make the checkbox to be in checked state after paging. I want to access the rows in a button click..

Thanks,
Erin
Princy
Top achievements
Rank 2
 answered on 10 Sep 2013
1 answer
102 views
i have the following piece of code:

 if (lgSentTo.length > 0) {
                        var temp = new Array();
                        // this will return an array with strings "1", "2", etc.
                        temp = lgSentTo.split(",");
                        for (a in temp) {
                            var site = temp[a].toString().trim();
                            GetRadTreeView().findNodeByText(site).disable();
                            GetRadTreeView().findNodeByText(site).checked = false;
                        }
                    }

while "disable()" works fine, i can't seem to uncheck anything.

i've also tried:   GetRadTreeView().findNodeByText(site).uncheck(); but am also getting nowhere. please assist.
: 
Shinu
Top achievements
Rank 2
 answered on 10 Sep 2013
1 answer
100 views
I have a RedEditor with the ID radEditor1 and the following javascript function:
// Character and Word Counter for Telerik RadEditor
//   Parameters:
//     ID of the RadEditor
//     Maximum number of words allowed
//     Returns false if maxWords is exceeded, true otherwise
 
function LimitWordCount(editorId, maxWords)
{
    var content = $find(editorId).get_text();
    var words = 0;
    var chars = 0;
    LimitWordCount = true;
    if (content) {
        punctRegX = /[!\.?;,:&_\-\-\{\}\[\]\(\)~#'"]/g;
        content = content.replace(punctRegX, "");
        if (content) {
            splitRegX = /\s+/;
            var array = content.split(splitRegX);
            words = array.length;
            chars = content.length;
        }
    }
    if (words > maxWords) {
        alert("Cannot exceed maximum word count.  Please shorten text.\nTo undo a paste, click the undo button at the top of the text area.")
        LimitWordCount = false;
    }
}

I call this function from the following link in a formview:
<asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Save" CssClass="linkbutton" OnClientClick='LimitWordCount("RadEditor1", 30)' />

When the javascript is hit, $find(editorId) returns null.

How would I get the text in this instance?  I have tried all the examples I can find, but all return null or give some other error. 

Help is appreciated!
Rumen
Telerik team
 answered on 10 Sep 2013
1 answer
53 views
Hello Telerik Team,

We are using telerik editor in our application, in ie9 i am not able to save the information entered in the editor
its working in chrome, firefox and ie8 and lower version browser
Please give me suggestions

Thanks,
Naveen 
Rumen
Telerik team
 answered on 10 Sep 2013
1 answer
127 views
Hi,

I have the latest dll version. Currently we are facing issues with the Treeview control.

When a parent node is selected, all the child nodes get selected but not the Parent node. I have tried with "TriStateCheckboxes = True", unfortunately when I deselect all the child nodes the parent is deselected.

Ex: I have departments and Sub-Departments and I assign employees at all levels. I have to filter on Employees belong to Parent department alone. I select only the Parent Department from the treeview for my filter.

This control was working as expected before we deploy the current dll. 

Please treat this on priority.

Thanks.
Shinu
Top achievements
Rank 2
 answered on 10 Sep 2013
12 answers
187 views
Hi,

I try to create a simple application using Telerik AJAX manager and below is my code:
VisualWebpart.ascx
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server" >
      <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="btn">
                 <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="lbl" LoadingPanelID="load1"  />
                 </UpdatedControls>
        </telerik:AjaxSetting>
      </AjaxSettings>
</telerik:RadAjaxManagerProxy>
 
 <asp:label ID="lbl" runat=server />
 <asp:Button ID="btn" runat=server Text="press" onclick="btn_Click" />

In my VisualWebpart.ascx.cs
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace DPA.DPINET.ResourceBooking.View.CalendarVW
{
    public partial class CalendarVWUserControl : UserControl
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            EnsureChildControls();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
           
          
        }

        protected void btn_Click(object sender, EventArgs e)
        {
            System.Threading.Thread.Sleep(3000);
            lbl.Text = DateTime.Now.ToString();
        }
    }
}


In my Master Page:
<asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" />
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
   </telerik:RadAjaxManager>
 <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </telerik:RadAjaxLoadingPanel>

My first click it did a postback, but the following click it did ajax call, only thing that the LoadingPanel didnt show up. This code work in normal ASP.NET page, but when try to move to my VisualWebPart annd deploy over to sharePoint 2010, it fail. Please advice.
Plamen
Telerik team
 answered on 10 Sep 2013
2 answers
82 views
Using the various examples of doing inplace editing/updating, I'm running into issues.  I have a radgrid that autogenerates the columns depending upon a question the user selects.  The page unto itself works fine.  The grid gets populated correctly and the inplace editing columns come up just fine.  Just nothing updates when I click the "update" button........

FYI - all columns are numeric double values.

The issue I've seen is that at the "For Each Column In e.Item.OwnerTableView.Columns" loop in the update subroutine, it does not cycle, catch, identify, know that, etc. there are columns in the grid.  I can have 44 autogenerated columns and this For/Next loop only executes once and then moves on.  

Any and all suggestions are more than welcome!

Here is the code on my aspx page:

<telerik:RadGrid ID="rg_GrowthRates" runat="server" AllowSorting="True"
    CellSpacing="0" GridLines="None"
    AllowFilteringByColumn="True" Width="100%"
    AllowPaging="True" PageSize="15"
    EnableViewState="False" ViewStateMode="Disabled" Skin="Metro"
    AllowAutomaticUpdates="True" AutoGenerateEditColumn="True">
    <MasterTableView DataKeyNames="ID_SurveyInstitutional" EditMode="InPlace" >
        <CommandItemSettings ShowAddNewRecordButton="False" />
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
            </EditColumn>
        </EditFormSettings>
        <EditItemStyle BackColor="LightSteelBlue" BorderColor="Black" BorderStyle="Dashed" BorderWidth="1px" HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
        <PagerStyle AlwaysVisible="True" PageSizes="15;30;45;60;All" />
        <CommandItemStyle BackColor="#FFFFC0" />
    </MasterTableView>
    <PagerStyle AlwaysVisible="True" PageButtonCount="15" PageSizes="15;30;45;60;All" />
</telerik:RadGrid>

In my code behind I have this as my grid source:

Private ReadOnly Property GridSource As DataTable
    Get
        Dim obj As Object = Me.ViewState("_gds")
        If (Not obj Is Nothing) Then
            Return CType(obj, DataTable)
        Else
            querystring = "SELECT ID_SurveyInstitutional, " & getDatabaseColumns(Session("selectedQuestion")) & " " & _
                            "FROM SurveyInstitutional " & _
                            "WHERE ID_AvailableQuarters = " & Session("selectedQuarter")
 
            RERCDataCenterConnection.Open()
            Dim existingCommand As New SqlCommand(querystring, RERCDataCenterConnection)
            Dim da As New SqlDataAdapter(existingCommand)
            Try
                da.Fill(questionTable)
            Catch ex As Exception
            Finally
                RERCDataCenterConnection.Close()
            End Try
 
            Me.ViewState("_gds") = questionTable
            Return questionTable
        End If
    End Get
End Property

My "getDatabaseColumns" routing (called above) populates the query depending upon the question the user has selected:
Function getDatabaseColumns(ByVal whichQuestion As Integer)
    Dim columnList As New DataTable
    Dim columnString As String = ""
    querystring = "SELECT DatabaseColumn FROM Const_InstitutionalColumnMatrix WHERE ID_Const_EditableQuestions = " & whichQuestion
    RERCDataCenterConnection.Open()
    Using getColumns As New SqlCommand(querystring, RERCDataCenterConnection)
        Dim da As New SqlDataAdapter(getColumns)
        Try
            da.Fill(columnList)
        Catch ex As Exception
        Finally
            RERCDataCenterConnection.Close()
        End Try
    End Using
 
    For Each row As DataRow In columnList.Rows
        columnString = columnString & row("DatabaseColumn") & ", "
    Next
 
    columnString = Left(columnString, Len(columnString) - 2)
    Return columnString
End Function

This is my 'needDataSource':
Private Sub rg_GrowthRates_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs) Handles rg_GrowthRates.NeedDataSource
 
    ' If they select "Select a Question from the dropdown then clear the grid
    If CInt(Session("selectedQuestion")) < 1 Then
        rg_GrowthRates.DataSource = New String() {}
        Exit Sub
    End If
 
    rg_GrowthRates.DataSource = Me.GridSource
 
End Sub

This is my update routine:
Private Sub rg_GrowthRates_UpdateCommand(sender As Object, e As GridCommandEventArgs) Handles rg_GrowthRates.UpdateCommand
     
    Dim item As GridEditableItem = DirectCast(e.Item, GridEditableItem)
    Dim currentID As String = item.GetDataKeyValue("ID_SurveyInstitutional").ToString()
 
    Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
    Dim editMan As GridEditManager = editedItem.EditManager
    Dim column As GridColumn
    For Each column In e.Item.OwnerTableView.Columns
        If TypeOf column Is IGridEditableColumn Then
            Dim editableCol As IGridEditableColumn = CType(column, IGridEditableColumn)
            If (editableCol.IsEditable) Then
                Dim editor As IGridColumnEditor = editMan.GetColumnEditor(editableCol)
                Dim editorText As String = ""
                Dim editorValue As Object = Nothing
                If (TypeOf editor Is GridTextColumnEditor) Then
                    editorText = CType(editor, GridTextColumnEditor).Text
                    editorValue = CType(editor, GridTextColumnEditor).Text
                End If
                If (TypeOf editor Is GridBoolColumnEditor) Then
                    editorText = CType(editor, GridBoolColumnEditor).Value.ToString()
                    editorValue = CType(editor, GridBoolColumnEditor).Value
                End If
                If (TypeOf editor Is GridDropDownColumnEditor) Then
                    editorText = CType(editor, GridDropDownColumnEditor).SelectedText + "; " + CType(editor, GridDropDownColumnEditor).SelectedValue
                    editorValue = CType(editor, GridDropDownColumnEditor).SelectedValue
                End If
                Try
                    Dim changedRows As DataRow() = Me.GridSource.Select("ID_SurveyInstitutional = " + editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("ID_SurveyInstitutional").ToString())
                    changedRows(0)(column.UniqueName) = editorValue
                    Me.GridSource.AcceptChanges()
                Catch ex As Exception
                    e.Canceled = True
                End Try
                processEdits(column.UniqueName, editorValue, currentID)
            End If
        End If
    Next
 
    rg_GrowthRates.MasterTableView.ClearEditItems()
 
End Sub

And finally, my 'processEdits' routine:
Protected Sub processEdits(ByVal columnName As String, ByVal newVal As String, ByVal currentID As Integer)
    Dim valueToUpdate As Double
    If Not IsDBNull(newVal) And Trim(newVal) <> "" Then
        valueToUpdate = CDbl(newVal)
 
        querystring = "UPDATE SurveyInstitutional " & _
                        "SET " & columnName & " = " & valueToUpdate & " " & _
                        "WHERE ID_SurveyInstitutional = " & CInt(currentID)
    Else
        RERCDataCenterConnection.Close()
        Exit Sub
    End If
 
    RERCDataCenterConnection.Open()
    Dim processEditAction As New SqlCommand(querystring, RERCDataCenterConnection)
    processEditAction.ExecuteNonQuery()
    RERCDataCenterConnection.Close()
    rg_GrowthRates.EditIndexes.Clear()
    rg_GrowthRates.Rebind()
End Sub
Angel Petrov
Telerik team
 answered on 10 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?