Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
216 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
512 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
245 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
72 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
3 answers
263 views

Hi,
I am working on Project which has a Radgrid, project was running successfully and the out come is alright. But my problem is filtering and paging is not working.

<telerik:RadGrid ID="RadGrid1" Skin="WebBlue" runat="server" AllowFilteringByColumn="true" AutoGenerateColumns="true" ShowStatusBar="True" GridLines="None" AllowPaging="true" PageSize="20" AllowSorting="True" onitemdatabound="RadGrid1_ItemDataBound" EnableLinqExpressions ="false"> 

<PagerStyle Mode="NextPrevAndNumeric" />
<GroupingSettings CaseSensitive="false" /> 

<MasterTableView AutoGenerateColumns="false" EditMode="InPlace" AllowFilteringByColumn="True" 
ShowFooter="True" TableLayout="Auto" AllowSorting="true" AllowPaging="true" PageSize="20">  

<Columns>

<telerik:GridBoundColumn FilterControlWidth="50px" DataField=" total_float " HeaderText="Total Float" SortExpression=" total_float " UniqueName=" total_float ">
</telerik:GridBoundColumn> 

</Columns>
</MasterTableView>
</telerik:RadGrid> 

 

 

 

 

 


This is my code and i placed only one row for sample. 


Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs)
RadGrid1.MasterTableView.AllowFilteringByColumn = True
RadGrid1.Rebind()
End Sub  

 

 

 

 

 

Also i placed this in my code(VB) behind file.
Can any one help me, Thanks in advance.

 

 

Eyup
Telerik team
 answered on 16 Jul 2012
1 answer
83 views


I want insert and databind in radcombobox ,
How i achieve this
RadComboBoxItem Item6 = new RadComboBoxItem(Resources.Ticket.Action_Knowledge_Base);
Item6.Value = "1";
Item6.ImageUrl = "../Content/images/contextmenu/knowledgebase.png";
ddl_Actions.Items.Insert(8, Item6);
 
RadComboBoxItem Item7 = new RadComboBoxItem(Resources.Ticket.Action_CustomAction);
Item7.Value = "9";
Item7.ImageUrl = "../Content/images/contextmenu/caction.png";
ddl_Actions.Items.Insert(9, Item7);
 
RadComboBoxItem Item8 = new RadComboBoxItem(Resources.Ticket.Ticket_RemoveFromFolder);
Item8.Value = "12";
Item8.ImageUrl = "../Content/images/contextmenu/remove-from-folder.png";
ddl_Actions.Items.Insert(10, Item8);
 
RadComboBoxItem Item10 = new RadComboBoxItem(Resources.Ticket.Ticket_Create_Change_Request);
Item10.Value = "10";
Item10.ImageUrl = "../Content/images/contextmenu/changerequest_conf.png";
ddl_Actions.Items.Insert(11, Item10);
 
RadComboBoxItem Item11 = new RadComboBoxItem(Resources.TicketSubscription.Subscribe);
Item11.Value = "11";
Item11.ImageUrl = "../Content/images/contextmenu/subscribe.png";
ddl_Actions.Items.Insert(12, Item11);
 
using (var db = new TBSHelpDeskDataContext(Globals.strCon))
{
    var md = (from a in db.CustomActions select new { a.CustomAction_ID, a.Name }).ToList();
    ddl_Actions.DataSource = md;
    ddl_Actions.DataValueField = "CustomAction_ID";
    ddl_Actions.DataTextField = "Name";
    ddl_Actions.DataBind();
}


Thanks Advance,
Mohamed.
Nencho
Telerik team
 answered on 16 Jul 2012
1 answer
88 views
I have a custom module that works fine if my rad editor starts "enabled".  On pages where the default state of the editor is disabled until the user puts the form into edit mode, the module just doesn't show up.  If I just change the initial state of the editor to enabled it works fine.  Is there something I need to be registering when the page mode is changed to edit to ensure that my custom module will show up? 
Rumen
Telerik team
 answered on 16 Jul 2012
1 answer
86 views
Dear Telerik,

I have some problem here in IE it's work well but in Google chrome all my control located in my Radgrid become freeze. I don't want to use EditItemTemplate in Radgrid because of my business problem. Here is my screenshot :

   
*Arrow red is indicating freeze control. I cannot change the value.

Here is some of my aspx :
<ItemTemplate>
    <telerik:RadNumericTextBox ID="lblNominationInstruction" runat="server" MaxLength="15"
        Width="100px" Visible="true" MinValue="0" NumberFormat-DecimalDigits="4" NumberFormat-DecimalSeparator="."
        NumberFormat-GroupSeparator="," NumberFormat-GroupSizes="3" NumberFormat-KeepNotRoundedValue="True"
        DisabledStyle-BorderStyle="None" Enabled="false" DisabledStyle-BackColor="Transparent"
        DisabledStyle-ForeColor="Black" Style="text-align: right" Text='<%# DataBinder.Eval(Container.DataItem, "EntryQuantity")%>'>
    </telerik:RadNumericTextBox>
    <asp:TextBox ID="txtNominationInstruction" MaxLength="15" runat="server" Visible="false"
        Width="100px" Style="text-align: right"></asp:TextBox>
</ItemTemplate>

In my simple term, my questions is :
"How can i using textbox, dropdownlist, and any other control inside RadGrid but I still can edit its value in Google Chrome ?"

Thanks.

Eyup
Telerik team
 answered on 16 Jul 2012
7 answers
294 views
I am using Rad File Explorer, i have disabled file navigator. I would like to display file count for folder as below.

Folder1(10)
Folder2(23)
.
.
.
.
Sample(200).

Can you please suggest a way?
Ashish
Top achievements
Rank 1
 answered on 16 Jul 2012
1 answer
90 views
Does anyone know how I can know when all files are finished uploading server-side, so I can redirect to another page?

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