Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
117 views
Hi,

I have Radcombobox with checkbox and Radgridview on my page and radcombobox is outside the radgridview.
Also, radcombobox has near about 100-200 items.

I am facing one performance issue while checking a checkbox specific to IE browser.
Issue is, when there are few records in the grid view, checking checkbox is faster. But when there are many records in the radgridview greater than 1500 or 2000, then checking checkbox is slower(It is taking near about 2 seconds to select a checkbox) on IE.

Please provide me solution on this.

Thanks.
Amol
Top achievements
Rank 1
 asked on 03 Jun 2013
9 answers
804 views
Hi all,
I have 2 problems to solve.
1. I am trying to filter a rad textbox in client side. I need to restrict special characters in it. Is there any control like FilteredTextBoxExtender to filter rad textbox ?

 I am really fed up with this.Please provide me a solution for this.

thanks
Abhi
Vasil
Telerik team
 answered on 03 Jun 2013
3 answers
118 views
Hi,

I'm using arraylist for my wrapper grid to bind the child grids in order to export pdf but data is getting exported in  pdf file with two header items "Capacity" and "Count", not sure from where these are coming.

            ArrayList arrayList = new ArrayList();
            arrayList.Insert(0, Performance.GetPerformanceData1());
            arrayList.Insert(1, Performance.GetPerformanceData2());

            RadGridWrapper.DataSource = arrayList;
            RadGridWrapper.DataBind();

I strongly believe ArrayList is creating problem with radgrid, please check and let me know the solution for that as I need to use ArrayList.

Attaching the snap shot for your reference, please have a look.


Daniel
Telerik team
 answered on 03 Jun 2013
1 answer
84 views
Hi I'm trying to work out if I can do the below.  Any advice on this would be helpful.

The short version

Can the AsyncUpload FileUploaded event be delayed till after an insert of a new record in order to obtain the newly inserted records id?

The long version

The scenario :

I have a db table which contains appointments.  An associated attachments table contains any files that are related to a particular appointment.

I'm using a bound radgrid which shows all appointments (using an entity data source with automatic inserts/updates). 
I want to allow the user to create a new appointment and as part of this allow attachments to be uploaded along with the new appointment. 
I insert the attachments into an attachment table and associate the attachments with the appointment by the appointment id.

The issue :

The issue  is that at the point of inserting the new appointment I am also inserting my attachment files (using RadAsyncUpload1_FileUploaded).  I require the appointment id at the point of inserting the attachments.  The appointment id is only generated on insert of the new record.

I stepped through the code and the FileUploaded triggers before the entitydatasource insert.

So I will have to insert the attachments with no associated appointment id.

On inserting the new appointment I would then have to update the attachments table and identify these new attachments, then associate the appointment id with them.  This seems very prone to potential errors.  The ideal solution would be if I can perform the entitydatasource insert before the file uploaded triggers as then I should be able to obtain the new appointment id and associate the new attachments records with this correctly.

Any suggestions on how to approach this problem would be appreciated. 

I can if necessary not allow uploads on the initial insert of the appointment.  Then if the user has attachments to upload they must edit the appointment and upload them at that point.  Uploading of the files when an appointment is edited is working correctly.

Thanks.

Kostadin
Telerik team
 answered on 03 Jun 2013
3 answers
63 views
Hi,
I have a problem that when i use the staticheaders option of the RadGrid, my export does not work. Only the first time.
The RadGrid exists in an updatepanel. I have registered the exelbutton as postbackcontrol to the scriptmanager.

In the ItemCreated eventhandler of the radgrid
System.Web.UI.Control ctrl = e.Item.FindControl("ExportToExcelButton");
System.Web.UI.ScriptManager.GetCurrent(grid.Page).RegisterPostBackControl(ctrl);

So when usestaticheaders = false, export works, when true not !

There is an old post where you mentioned the usestaticheaders should be set to false when exporting, is this still relevant or not?
The post:
http://www.telerik.com/community/forums/aspnet-ajax/grid/export-grid-within-updatepanel.aspx

I also tried it adding following function, but in our application it does not work, only the first option, (register as portbackbutton)

Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(initializeRequestHandler);
 
function initializeRequestHandler(sender, args)
{
   if (args.get_postBackElement().id.indexOf("ExportToExcelButton") != -1)
   {
      args.set_cancel(true);
      sender._form["__EVENTTARGET"].value =
      args.get_postBackElement().id.replace(/\_/g, "$");
      sender._form["__EVENTARGUMENT"].value = "";
      sender._form.submit()
   }
}

Thanks in advance
Rudy
Kostadin
Telerik team
 answered on 03 Jun 2013
3 answers
104 views
We've gotten a request to make a change to an existing application that uses a RadAjaxLoadingPanel which is used to show a loading message for a RadAjaxPanel which has a RadGrid inside of it and works as expected with the loading message covering the whole grid but we want it to only display the loading message over the row that has been selected (because a NestedViewTemplate is shown on row select which has to perform a database lookup).

All of the example projects and search results show this happening over the entire grid so I'm wondering if this is possible.  Thanks.
J
Top achievements
Rank 1
 answered on 03 Jun 2013
5 answers
274 views
Hi all,

I am having an issue with the RadGrid and it is concerned with postbacks. Basically what I have is two Grids and a Scheduler in a RadAjaxPanel, and the user can drag rows from either Grid onto the Scheduler, or from one Grid to another. This all happens asynchronously of course. I am handling the OnRowDragStarted and OnRowDropping client side events in order to get and set variables regarding what data item is being moved around. In the client-side rowDropping function after getting the variables I need from the page I am calling __doPostBack() setting the appropriate control as the eventTarget, and passing the data in the eventArgument.

My problem is that the RadGrids always fire a postback even though I am not specifying any server-side event handlers other than OnItemDataBound, and these postbacks happen immediately after my __doPostBack() call and thus cancels it out. I can see this happening in FireBug whereby my explicit post is sent at the same time as the Grid's automatic post.

I am stuck as to how to get my __doPostBack() to actually work and not be overridden by the Grid's built in postback. Anyone have any ideas?

Here's some code:

First Grid:
 
<telerik:RadGrid ID="tripsGrid" runat="server" AutoGenerateColumns="false"
    onitemdatabound="tripsGrid_ItemDataBound">
<ClientSettings AllowRowsDragDrop="true">
    <Selecting AllowRowSelect="true" />
    <ClientEvents OnRowDragStarted="rowDragging" OnRowDropping="rowDropping" />
</ClientSettings>
<MasterTableView DataKeyNames="ID,TripID,TripType" InsertItemDisplay="Bottom" EditMode="PopUp">
    <SortExpressions>
        <telerik:GridSortExpression FieldName="Timing" SortOrder="Ascending" />
    </SortExpressions>
    <Columns>
        ... columns removed ...
    </Columns>                               
</MasterTableView>                           
</telerik:RadGrid>
 
Second Grid:
 
<telerik:RadGrid ID="taxiGrid" runat="server" AutoGenerateColumns="false"
    onitemdatabound="taxiGrid_ItemDataBound">
<ClientSettings AllowRowsDragDrop="true">
    <Selecting AllowRowSelect="true" />
    <ClientEvents OnRowDragStarted="rowDragging" OnRowDropping="rowDropping" />
</ClientSettings>
<MasterTableView DataKeyNames="ID,TripID,TripType" InsertItemDisplay="Bottom" EditMode="PopUp">
    <SortExpressions>
        <telerik:GridSortExpression FieldName="Timing" SortOrder="Ascending" />
    </SortExpressions>
    <Columns>
        ... columns removed ...
    </Columns>                               
</MasterTableView>                           
</telerik:RadGrid>
 
Javascript:
 
// Fires when row dragging commences (onmousedown)
function rowDragging(sender, eventArgs)
{
    var rowIndex = eventArgs.get_itemIndexHierarchical();
    var sourceGrid = sender;
                 
    var row = sourceGrid.Control.children[0].rows[parseInt(rowIndex) + 1];
    var rowElements = row.getElementsByTagName("input");
 
    // Store the dragged trip ID and type in hidden fields
    $get("DraggedTripID").value = rowElements[0].value;
    $get("DraggedTripType").value = rowElements[1].value;
 
    var rowIndexWithHeader = parseInt(rowIndex) + 1;
    console.log("Trip ID: " + rowElements[0].value + ", Type: " + rowElements[1].value + ", Row index: " + rowIndexWithHeader);                               
}
 
// Fired when the user drops a grid row (onmouseup)
function rowDropping(sender, eventArgs)
{               
    var id = $get("DraggedTripID").value;
    var type = $get("DraggedTripType").value;
    var sourceElement;
    var targetElement;
 
    // Get the grid trip came from               
    if (sender.ClientID == "<%= tripsGrid.ClientID %>") {
        sourceElement = "UnallocatedTrips";
    }
    else if (sender.ClientID == "<%= taxiGrid.ClientID %>") {
        sourceElement = "TaxiTrips";
    }
    else {
        eventArgs.set_cancel(true);
        return;
    }
                 
    // Get the target element row was dropped on               
    var htmlElement = eventArgs.get_destinationHtmlElement();
                 
    if (isPartOfSchedulerAppointmentArea(htmlElement))  // Row dropped over the scheduler - find time slot and save its index in hidden field
    {
        targetElement = "Scheduler";
 
        var scheduler = $find("<%= tripScheduler.ClientID %>");
        var timeSlot = scheduler._activeModel.getTimeSlotFromDomElement(htmlElement);
        $get("TargetSlotHiddenField").value = timeSlot.get_index();
 
        eventArgs.set_destinationHtmlElement("TargetSlotHiddenField"); // HTML needs to be set for postback to execute normally
    }
    else if (isPartOfTaxiTripsArea(htmlElement)) // Row dropped over the taxi grid
    {
        targetElement = "TaxiTrips";
 
        $get("TargetSlotHiddenField").value = "taxi";
        eventArgs.set_destinationHtmlElement("TargetSlotHiddenField");
    }
    else if (isPartOfUnscheduledTripsArea(htmlElement)) // Row dropped over unscheduled trips grid
    {
        targetElement = "UnallocatedTrips";
 
        $get("TargetSlotHiddenField").value = "taxi";
        eventArgs.set_destinationHtmlElement("TargetSlotHiddenField");
    }
    else
    {
        eventArgs.set_cancel(true); // The node was dropped in an irrelevant region - cancel the drop
    }
                 
    // Submit the change
    submitTripChange(id, type, sourceElement, targetElement);
}
 
// Submit a trip change via asyncronous postback
function submitTripChange(tripId, tripType, source, target)
{
    if (source == target)
        return;
                  
    // Set the event target - which control initiated the operation
    var eventTarget;
    if (source == "UnallocatedTrips")
        eventTarget = "<%= tripsGrid.UniqueID %>";
    else if (source == "TaxiTrips")
        eventTarget = "<%= taxiGrid.UniqueID %>";
    else
        return;
  
    // Set the event argument to contain parameters for modifying the trip
    var eventArgument = "TripMoved|" + tripId + "," + tripType + "," + source + "," + target;
  
    // Trigger the postback (asyncronous as long as eventTarget is an AJAXified control)
    __doPostBack(eventTarget, eventArgument);
}
Angel Petrov
Telerik team
 answered on 03 Jun 2013
10 answers
133 views
I have the following grid and column editor declared:

<telerik:RadGrid ID="grdItems" runat="server" AllowAutomaticDeletes="True" AllowSorting="True"
    PageSize="12" AutoGenerateColumns="False" OnNeedDataSource="grdItems_NeedDataSource"
    OnItemCommand="grdItems_ItemCommand" OnPreRender="grdItems_PreRender" OnUpdateCommand="grdItems_UpdateCommand"
    Width="456px" OnDeleteCommand="grdItems_DeleteCommand" OnEditCommand="grdItems_EditCommand"
    OnItemDataBound="grdItems_ItemDataBound" ShowStatusBar="True" AllowAutomaticInserts="True"
    AllowAutomaticUpdates="True" OnItemCreated="grdItems_ItemCreated" Skin="Metro"
    BorderStyle="None" CellSpacing="0" GridLines="None" ForeColor="White" BackColor="Transparent"
    ShowFooter="True" AllowMultiRowEdit="True">
    <ValidationSettings ValidationGroup="ItemsGrid" />
    <ClientSettings AllowKeyboardNavigation="True">
        <Selecting AllowRowSelect="True" />
        <KeyboardNavigationSettings AllowSubmitOnEnter="True" AllowActiveRowCycle="True" />
        <Scrolling AllowScroll="True" UseStaticHeaders="True" SaveScrollPosition="true" />
        <ClientEvents OnKeyPress="OnKeyPress" OnRowSelected="RowSelected" OnRowClick="RowClick"
            OnRowDblClick="RowDblClick" OnGridCreated="GridCreated" OnCommand="GridCommand" />
        <Resizing ShowRowIndicatorColumn="False" />
    </ClientSettings>
    <AlternatingItemStyle BackColor="LightGray" BorderStyle="None" ForeColor="Black" />
    <EditItemStyle BackColor="Gainsboro" BorderStyle="None" />
    <FooterStyle BorderStyle="None" />
    <HeaderStyle BorderStyle="None" Height="48px" HorizontalAlign="Left" VerticalAlign="Middle" />
    <ItemStyle BackColor="White" BorderStyle="None" ForeColor="Black" />
    <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
    <SelectedItemStyle BorderStyle="None" />
    <FilterMenu EnableImageSprites="False" />
    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default" />
    <MasterTableView NoMasterRecordsText="No items to display." EditMode="InPlace"
        CommandItemDisplay="None" BorderStyle="None" BackColor="Transparent" ShowFooter="False">
        <HeaderStyle BorderStyle="None" Font-Bold="True" Font-Size="Medium" ForeColor="White"
            Height="48px" HorizontalAlign="Left" VerticalAlign="Middle" Wrap="True" />
        <CommandItemStyle CssClass="rgCommandRow" />
        <FooterStyle BorderStyle="None" CssClass="grid-footer" />
        <CommandItemTemplate>
            <div>
                <asp:LinkButton ID="btnRemoveSelected" runat="server" CommandName="RemoveSelected">
                    <img style="border:0px;vertical-align:middle;" alt="Remove Selected Items" src="Images/GradientCancel_32x32.png" />  Remove Selected Items</asp:LinkButton>  
             </div>
        </CommandItemTemplate>
        <CommandItemSettings ExportToPdfText="Export to PDF" ShowRefreshButton="False" AddNewRecordText="Add Item">
        </CommandItemSettings>
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <EditFormSettings EditFormType="Template">
            <EditColumn FilterControlAltText="Filter EditCommandColumn column" CancelImageUrl="Cancel.gif"
                InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" Visible="true" Display="true">
            </EditColumn>
        </EditFormSettings>
        <ItemStyle BackColor="White" BorderStyle="None" ForeColor="Black" />
        <AlternatingItemStyle BackColor="LightGray" BorderStyle="None" ForeColor="Black" />
        <EditItemStyle BackColor="Gainsboro" BorderStyle="None" />
        <PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
        <Columns>
            <telerik:GridCheckBoxColumn ConvertEmptyStringToNull="False"
                FilterControlAltText="Filter checked column" SortExpression="Checked"
                UniqueName="Checked">
                <HeaderStyle Wrap="False" HorizontalAlign="Left" Width="32px" CssClass="grid-header grid-header-first" />
                <ItemStyle HorizontalAlign="Center" Width="100%" VerticalAlign="Top" />
            </telerik:GridCheckBoxColumn>
            <telerik:GridNumericColumn DataField="Quantity" DataType="System.Int16"
                DecimalDigits="0" DefaultInsertValue="1" ColumnEditorID="txtGridEditor_Quantity"
                FilterControlAltText="Filter Quantity column" HeaderText="Quantity"
                ShowSortIcon="False" SortExpression="Quantity" UniqueName="Quantity">
                <HeaderStyle CssClass="grid-header" HorizontalAlign="Left" Width="80px" Wrap="False" />
                <ItemStyle HorizontalAlign="Center" Width="100%" VerticalAlign="Top" />
            </telerik:GridNumericColumn>
            <telerik:GridBoundColumn DataField="Item" HeaderText="Item" UniqueName="Item"
                ConvertEmptyStringToNull="False" EmptyDataText="" SortExpression="Item"
                ShowSortIcon="False" ReadOnly="True">
                <HeaderStyle Wrap="False" HorizontalAlign="Left" Width="180px" CssClass="grid-header" />
                <ItemStyle HorizontalAlign="Left" Width="100%" VerticalAlign="Top" />
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn ConvertEmptyStringToNull="False" DataField="Category" EmptyDataText=""
                FilterControlAltText="Filter Category column" HeaderText="Category" SortExpression="Category"
                UniqueName="Category" ReadOnly="True">
                <HeaderStyle CssClass="grid-header" Width="80px"  />
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100%" />
            </telerik:GridBoundColumn>
            <telerik:GridNumericColumn dataFormatString="{0:$###,##0.00}" DataField="Price"
                DataType="System.Decimal" NumericType="Currency"
                HeaderText="Price" SortExpression="Price" UniqueName="Price" Aggregate="Sum"
                FooterAggregateFormatString="{0:C}" ReadOnly="True">
                <HeaderStyle CssClass="grid-header" Width="60px"  />
                <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" Width="100%" />
            </telerik:GridNumericColumn>
            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" FilterControlAltText="Filter DeleteColumn column"
                ImageUrl="Images/305_Close_16x16_72.png" Text="" UniqueName="DeleteColumn" Resizable="false"
                ConfirmText="Remove this item?" ConfirmDialogType="RadWindow" ConfirmTitle="Remove"
                ShowInEditForm="True">
                <HeaderStyle Wrap="False" HorizontalAlign="Left" Width="24px" CssClass="grid-header grid-header-last">
                </HeaderStyle>
                <ItemStyle Width="100%" HorizontalAlign="Right" VerticalAlign="Top" />
            </telerik:GridButtonColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<telerik:GridTextBoxColumnEditor ID="txtGridEditor_Quantity" runat="server" TextBoxStyle-Width="98%" />

The grid works as expected EXCEPT when it comes to rendering the column editor for the Quantity field.  See the attached screenshot.  The Quantity field text box is sized way beyond what the column width is and I cannot figure out a way to get it to size appropriately.  Whether I specify a ColumnEditorID or not, it displays this way.  This is similar to a previous post when trying to customize masked text fields and that was acknowledged as bug on Telerik's end.

Is this the same issue or am I doing something incorrectly?  I can't imagine that no one else has encountered this issue since I've been encountering it without doing anything out of the ordinary in multiple projects.  I've even gone so far as to remove ALL css to make sure something there wasn't causing it but it displays the same way.
J
Top achievements
Rank 1
 answered on 03 Jun 2013
1 answer
107 views
Hi,
i have RadTreeviewContextMenu and RadMenu in my app.
This RadMenu is in Masterpage
<telerik:RadMenu ID="RadMenuMaster" runat="server" EnableEmbeddedSkins="false"
                                        EnableEmbeddedBaseStylesheet="false"
                                         DataSourceID="SiteMapDataSource1"
                                       EnableShadows="True" Style="z-index: 1000;">
                                   </telerik:RadMenu>

This is my TreeView in Default.aspx
<telerik:RadTreeView ID="RadTreeViewFileShare" runat="server" >
               <ContextMenus>
                   <telerik:RadTreeViewContextMenu ID="RadTreeViewContextMenuFs" runat="server">
                       <Items>
                           <telerik:RadMenuItem>
                               <ItemTemplate>
                                   <asp:Panel ID="PanelFindNode" runat="server" style="padding:5px;" DefaultButton="ButtonFindTreeNode">
                                   <asp:Label ID="LabelFindNode" runat="server" Text="Find Node:" AssociatedControlID="TextBoxFindTreeNode" /> 
                                   <asp:TextBox ID="TextBoxFindTreeNode" runat="server" AutoCompleteType="Search"></asp:TextBox>
                                   <asp:ImageButton ID="ButtonFindTreeNode" runat="server" ImageUrl="~/Images/Search/Search.ico"
                                       ToolTip="Search for node" OnClick="ButtonFindTreeNode_Click" ImageAlign="Middle" />
                                  </asp:Panel>
                               </ItemTemplate>
                           </telerik:RadMenuItem>
                       </Items>
                   </telerik:RadTreeViewContextMenu>
               </ContextMenus>
       </telerik:RadTreeView>
Why does the Stylesheet affects the RadMenu.
When i comment out the RadTreeViewContextMenu everything work fine.

Any Idea
Thanks
Kate
Telerik team
 answered on 03 Jun 2013
1 answer
63 views
I have a Telerik Report which uses some parameters to generate the report. It generates the report fine in all circumstances except when I open a RadWindow and hit the browser's back button. The Radwindow when opens refreshes the report and generates the report in the background fine which means it still has the parameters. The report is fine even when I close the radwindow through its close button. But if I hit back button to go to the report from the radwindow the report loses the parameter (this is my best guess) and the report gives errors in red boxes. Is there a way that I can make it not lose the parameters and get the report back.
Note: If I hit browser's back button from any page other than radwindow to this report, the report runs fine.
I would appreciate the help.
Thank you,
Nekud
Slav
Telerik team
 answered on 03 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?