Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
112 views
I have a page with a grid and when the datasource the grid is bound to has no rows, when the grid displays the filter boxes are not displayed.  A checkbox on the page where the grid is displayed can be checked by the user which then creates a new datasource that does have rows based on a different search criteria and the grid redisplays but the filter boxes are not shown and thus the grid rows cannot be filtered.  Is there a way to force the display of the filter boxes after the datasource is refreshed?
Shinu
Top achievements
Rank 2
 answered on 17 Jul 2012
1 answer
152 views
I have a RadDateTimePicker which in edit mode you may want to set text to nothing e.g. select the date string and press delete button on your keyboard. However the date is still present so i can't find out if user has deleted the text or not. How do i do that?

Basically i need to find out if RadDateTimePicker.Text = String.Empty and set the SqlParameter value to DbNull.Value

Thank you so much
Shinu
Top achievements
Rank 2
 answered on 17 Jul 2012
2 answers
93 views
I have an issue with formviews being nested inside the templatecolumn of a radGrid and the whole thing is wrapped in an updatepanel.
A dropdown list refreshes data inside the template columns on index changed, and performs a databind on each formview found in each row.
If the dataitemcount of the formview is 0 it goes to insert which works fine.

The problem is when changing the mode to insert on the formview, it will NOT go back to readonly mode even when there is data.  I'm getting double ups in the database from users thinking there's no data.  I'm getting no errors reported by the system.  It just won't pick up the dataitemcount going to 1.
I can force it to readonly in the script, but I can't get it to changemode using dataitemcount any more.

I'm doing the formview refresh using the following code contained in a dropdown_selectedindexchanged function.

        foreach (GridDataItem ri in RadGrid1.Items)
        {
            Label Label1 = (Label)ri.FindControl("Label1");
            Label1.Text = DropDownList2.SelectedItem.Text;
            FormView fw1 = (FormView)ri.FindControl("fw1");
            fw1.DataBind();

            if (fw1.DataItemCount> 0)
            {
                
            }
            else
            {
                fw1.ChangeMode(FormViewMode.Insert);
            }

UpdatePanel1.update();
}


any ideas how I can get it to change back??
Morgan
Top achievements
Rank 2
 answered on 17 Jul 2012
2 answers
449 views
I have a client asking to have an Export Excel button appear outside of the RadGrid. Is it possible in this scenerio for the button to call the RadGrid's built-in functionality of exporting to Excel? If so, how can I achieve this?

Thanks,

-Scott
Scott
Top achievements
Rank 1
 answered on 16 Jul 2012
3 answers
226 views
Hello,

Using Telerik.Web.UI_2011_3_1305
I have a SQL Server table with approx 600,000 records and 28 columns. I created an ASP.Net page with a RadGrid set-up in "Grid / Virtual Scrolling and Paging" as described in the article at:  
http://demos.telerik.com/aspnet-ajax/grid/examples/client/virtualscrollpaging/defaultcs.aspx
(see code below)
However the performance is poor: loading a new grid page takes a very long time, approx 30 seconds...

Please also note the following:
- the SQL Server database is hosted on the same machine
- the development machine is very fast and has 6GB of RAM
Therefore it is not the environment that causes the performance issue.

Please advise.
Regards,
M.R.

<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="SqlDataSource1"
   GridLines="None" Width="916px" AllowPaging="True" VirtualItemCount="5000" PageSize="10">
   <ClientSettings>
     <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True"
       SaveScrollPosition="True"></Scrolling>
   </ClientSettings>
   <MasterTableView AutoGenerateColumns="False" DataKeyNames="SBACTN" DataSourceID="SqlDataSource1"
     AllowCustomPaging="False" AllowPaging="True" AllowSorting="True" VirtualItemCount="5000"
     AlternatingItemStyle-ForeColor="#CC00CC">
     <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
     <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
       <HeaderStyle Width="20px"></HeaderStyle>
     </RowIndicatorColumn>
     <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
       <HeaderStyle Width="20px"></HeaderStyle>
     </ExpandCollapseColumn>
     <Columns>
       <telerik:GridBoundColumn DataField="SBSACT" FilterControlAltText="Filter SBSACT column"
         HeaderText="SBSACT" SortExpression="SBSACT" UniqueName="SBSACT">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBACTN" FilterControlAltText="Filter SBACTN column"
         HeaderText="SBACTN" ReadOnly="True" SortExpression="SBACTN" UniqueName="SBACTN">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBNAM" FilterControlAltText="Filter SBNAM column"
         HeaderText="SBNAM" SortExpression="SBNAM" UniqueName="SBNAM">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBSTAT" FilterControlAltText="Filter SBSTAT column"
         HeaderText="SBSTAT" SortExpression="SBSTAT" UniqueName="SBSTAT" ReadOnly="False">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBCTY2" FilterControlAltText="Filter SBCTY2 column"
         HeaderText="SBCTY2" SortExpression="SBCTY2" UniqueName="SBCTY2">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBCTY1" FilterControlAltText="Filter SBCTY1 column"
         HeaderText="SBCTY1" SortExpression="SBCTY1" UniqueName="SBCTY1">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBGRID" FilterControlAltText="Filter SBGRID column"
         HeaderText="SBGRID" SortExpression="SBGRID" UniqueName="SBGRID">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBCNCL" FilterControlAltText="Filter SBCNCL column"
         HeaderText="SBCNCL" SortExpression="SBCNCL" UniqueName="SBCNCL">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBI2NO" FilterControlAltText="Filter SBI2NO column"
         HeaderText="SBI2NO" SortExpression="SBI2NO" UniqueName="SBI2NO">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBDMS1" FilterControlAltText="Filter SBDMS1 column"
         HeaderText="SBDMS1" SortExpression="SBDMS1" UniqueName="SBDMS1">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBDMS2" FilterControlAltText="Filter SBDMS2 column"
         HeaderText="SBDMS2" SortExpression="SBDMS2" UniqueName="SBDMS2">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBDTIN" DataType="System.DateTime" FilterControlAltText="Filter SBDTIN column"
         HeaderText="SBDTIN" SortExpression="SBDTIN" UniqueName="SBDTIN">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBDTCN" DataType="System.DateTime" FilterControlAltText="Filter SBDTCN column"
         HeaderText="SBDTCN" SortExpression="SBDTCN" UniqueName="SBDTCN">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBDTST" DataType="System.DateTime" FilterControlAltText="Filter SBDTST column"
         HeaderText="SBDTST" SortExpression="SBDTST" UniqueName="SBDTST">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBLANG" FilterControlAltText="Filter SBLANG column"
         HeaderText="SBLANG" SortExpression="SBLANG" UniqueName="SBLANG">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBCONT" FilterControlAltText="Filter SBCONT column"
         HeaderText="SBCONT" SortExpression="SBCONT" UniqueName="SBCONT">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBADDR" FilterControlAltText="Filter SBADDR column"
         HeaderText="SBADDR" SortExpression="SBADDR" UniqueName="SBADDR">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBSTR" FilterControlAltText="Filter SBSTR column"
         HeaderText="SBSTR" SortExpression="SBSTR" UniqueName="SBSTR">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBCTY" FilterControlAltText="Filter SBCTY column"
         HeaderText="SBCTY" SortExpression="SBCTY" UniqueName="SBCTY">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBPROV" FilterControlAltText="Filter SBPROV column"
         HeaderText="SBPROV" SortExpression="SBPROV" UniqueName="SBPROV">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBPOST" FilterControlAltText="Filter SBPOST column"
         HeaderText="SBPOST" SortExpression="SBPOST" UniqueName="SBPOST">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBTEL" FilterControlAltText="Filter SBTEL column"
         HeaderText="SBTEL" SortExpression="SBTEL" UniqueName="SBTEL">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBDTSG" DataType="System.DateTime" FilterControlAltText="Filter SBDTSG column"
         HeaderText="SBDTSG" SortExpression="SBDTSG" UniqueName="SBDTSG">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBFMS7" FilterControlAltText="Filter SBFMS7 column"
         HeaderText="SBFMS7" SortExpression="SBFMS7" UniqueName="SBFMS7">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBFMS1" FilterControlAltText="Filter SBFMS1 column"
         HeaderText="SBFMS1" SortExpression="SBFMS1" UniqueName="SBFMS1">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBCOMP" FilterControlAltText="Filter SBCOMP column"
         HeaderText="SBCOMP" SortExpression="SBCOMP" UniqueName="SBCOMP">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBFMS5" FilterControlAltText="Filter SBFMS5 column"
         HeaderText="SBFMS5" SortExpression="SBFMS5" UniqueName="SBFMS5">
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="SBSIC" FilterControlAltText="Filter SBSIC column"
         HeaderText="SBSIC" SortExpression="SBSIC" UniqueName="SBSIC">
       </telerik:GridBoundColumn>
     </Columns>
     <EditFormSettings>
       <EditColumn FilterControlAltText="Filter EditCommandColumn column">
       </EditColumn>
     </EditFormSettings>
   </MasterTableView>
   <FilterMenu EnableImageSprites="False">
   </FilterMenu>
 </telerik:RadGrid>
M. R.
Top achievements
Rank 1
 answered on 16 Jul 2012
5 answers
453 views
I have a web page that is a list of reports.  I use a RadWindow to get the user to enter parameters for the report.  Is it possible to get the RadWindow to open a new browser window that is active?  I'm using the javascript below which opens the report in a new window but it ends up behind my report selection window.

function returnToParent() 
    window.open(report + paras, """height=740,scrollbars=yes,width=1000,status=yes,toolbar=yes,menubar=yes,resizable=yes"); 
    self.close(); 


I think what's happening is the RadWindow opens the new browser window then closes and the focus reverts back to the parent window.  End result is the new browser window opened for the report is behind my report selection window.  I'd live to have the new window appear on top as the active window.  Any ideas?
bdrennen
Top achievements
Rank 1
 answered on 16 Jul 2012
4 answers
286 views
We are using jQuery to identify if a form isDirty which works great except when there is a radComboBox that has a selectedIndexChanged and loadsOnDemand?  When the user types something in the  RadComboBox,  jQuery sees the form as Dirty and when the user clicks cancel from the confirmation popup there is an error.  

Is there a way to exclude the radComBox for the isDirty?

OR

Is there a way to stop the RadComboBox from postingBack to the OnSelectedIndexChanged if the user selects cancel from the confirmation popup?

Attached is the error and here are snippets of our code:

<telerik:RadComboBox runat="server" ID="PermitRadComboBox" Height="190px" Width="250px" 
    EmptyMessage="Type a code or name" MarkFirstMatch="true" EnableLoadOnDemand="true" 
    HighlightTemplatedItems="true" OnClientItemsRequested="UpdateItemCountField" 
    OnDataBound="PermitRadComboBox_DataBound" OnItemDataBound="PermitRadComboBox_ItemDataBound" 
    OnItemsRequested="PermitRadComboBox_ItemsRequested" DropDownWidth="450px" AutoPostBack="True" 
    CausesValidation="False" OnSelectedIndexChanged="PermitRadComboBox_SelectedIndexChanged">  
    <HeaderTemplate> 
        <ul> 
            <li class="col1">Number</li> 
            <li class="col2">Permittee</li> 
        </ul> 
    </HeaderTemplate> 
    <ItemTemplate> 
        <ul> 
            <li class="col1">  
                <%# DataBinder.Eval(Container.DataItem, "permit_number") %></li>  
            <li class="col2">  
                <%# DataBinder.Eval(Container.DataItem, "permittee") %></li>  
        </ul> 
    </ItemTemplate> 
    <FooterTemplate> 
        A total of  
        <asp:Literal runat="server" ID="RadComboItemsCount" /> 
        items  
    </FooterTemplate> 
</telerik:RadComboBox> 


<script type="text/javascript">  
 
    var isDirty = false;  
    var msg = 'This page has unsaved changes.\n\nClick OK to abandon the changes and leave the page.\n\nClick Cancel to stay on the page so you can save your changes.';  
 
    $(document).ready(function ()  
    {  
        $(':input').change(function ()  
        {  
            if (!isDirty)  
            {  
                isDirty = true;  
            }  
        });  
 
        window.onbeforeunload = function ()  
        {  
            if (isDirty) return msg;  
        };  
    });  
 
</script> 


We are very new to the jQuery framework so any help very much appreciated.

Thanks in advance,
Gene.


Phil
Top achievements
Rank 1
 answered on 16 Jul 2012
3 answers
573 views
Hi

I have to cancel the event if the condition is False, for example: I have a treeview with images, before opening the image is valid if the image is already displayed, if it is  already displayed have to cancel the event, not allowing it to spread

how I do this

thanks

<telerik:RadTreeView ID="DocTreeView" runat="server" CssClass="cssTreeView" Height="100%"
Width="285"  OnClientNodeClicked ="onclickTreeview" onNodeClick="DocTreeView_NodeClick">
 </telerik:RadTreeView>

My Jquery Code
function onclickTreeview(sender, args) {
     
       code........
        
        if (!AllowImageOpen) {
            alert('This image is now displayed');
            // cancel the event here
        }
    }
}

Ivana
Telerik team
 answered on 16 Jul 2012
5 answers
290 views
I'm building a control that runs inside of the DetailsView of Rad TreeList.

My naming container is a TreeListDetailTemplateItem. From this context, I can't find an easy way to get access to the TreeListDataItem for this row (To get DisplayIndex). If it happens we are data-binding, I can do this hack:

           var detaiItem = (this.NamingContainer as TreeListDetailTemplateItem);
           if (detailItem.DataItem != null)
           {
//HACK: Cast to my business class, use the key value to find the appropriate treelistDataItem
               var itemId = (detailItem.DataItem as CheckListItem).CheckListItemID;
               treeListDataItem  = RadTreeList1.Items.Where(i => (int) i.GetDataKeyValue("CheckListItemID") == itemId).SingleOrDefault();
     var displayIndex = treeListDataItem.DisplayIndex
    .....
           }


I have the same limitation from within TreeList -> ItemCreated(). When trying to draw a Context menu for my DetailsView body, I run into an issue getting the DisplayIndex. Per this example: http://www.telerik.com/community/forums/aspnet-ajax/treelist/dose-the-tree-list-have-a-context-menu-funcationality.aspx#1428456

I had to hack around it using this code:

protected void RadTreeList1_ItemCreated(object sender, TreeListItemCreatedEventArgs e)
{
    TreeListDataItem treeListDataItem = null;
 
 
    if (e.Item is TreeListDataItem )
    {
        treeListDataItem = (TreeListDataItem)e.Item;   
        treeListDataItem.Attributes["oncontextmenu"] = "ShowContextMenu(" + treeListDataItem.DisplayIndex + ", event);";
         
    }
    else if (e.Item is TreeListDetailTemplateItem)
    {
        // We need the TreeListDataDataItem so we can use it's Display Index
 
 
        var detailItem = (e.Item as TreeListDetailTemplateItem);
        if (detailItem.DataItem != null)
        {
            var itemId = (detailItem.DataItem as CheckListItem).CheckListItemID;
            treeListDataItem  = RadTreeList1.Items.Where(i => (int) i.GetDataKeyValue("CheckListItemID") == itemId).SingleOrDefault();
            detailItem.Attributes["oncontextmenu"] = "ShowContextMenu(" + treeListDataItem.DisplayIndex + ", event);";
        }
    }
         
 
 
}


Anyone know some magical cast/path to jump from TreeListDetailTemplateItem to TreeListDataItem? Also, will these controls be implementing IDataItemContainer anytime soon?



Tsvetina
Telerik team
 answered on 16 Jul 2012
1 answer
102 views

Hi
In my sharepoint 2010 application, need to select a folder thru folder dialog window/popup. How to create it.
Is it possible with any telerik/asp.net controls (or) Is any other way to get dialog window with selecting a folder and upload all the files from folder.

Note: I know RadUpload control upload one file at a time. I need to select folder, no matter what how many files exists in the folder.

regards
Jay

Plamen
Telerik team
 answered on 16 Jul 2012
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?