Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
104 views

I need to change the background color of the text box based on the value the user enters.  For instance if the value is less than 10 then I want the background to be blue, if it greater than 20 I want it to be red.  Between 10 and 20 the background should remain white.  I have tried changing the style.background property in the onBlur client event, but have not had any success.  Any help would be appriciated.

 

Eyup
Telerik team
 answered on 20 Nov 2015
5 answers
577 views

I have a RadGrid with 3 levels of hierarchy declared as below (some markup left out for readability)

<telerik:RadGrid    ID="RadGrid1"   
                    runat="server"   
                    AllowSorting="True"   
                    Skin="Office2007"   
                    ShowStatusBar="True"   
                    GridLines="None"   
                    DataSourceID="SQLDataSource1"   
                    AutoGenerateColumns="False" 
                    EnableViewState="true">  
 
    <MasterTableView    HierarchyLoadMode="ServerBind"   
                        EnableNoRecordsTemplate="true"   
                        DataKeyNames="PartGroupID,PartGroupParentID"   
                        Width="100%"   
                        ShowHeader="true"   
                        AllowPaging="false">  
                            <SelfHierarchySettings  ParentKeyName="PartGroupParentID"   
                                                    KeyName="PartGroupID"   
                                                    MaximumDepth="10" /> 

Users will expand/collapse and collapse the structure, but will also modify the data in the grid. When the data is modified, the RadGrid needs to rebind.

RadGrid1.Rebind(); 

Unfortunately when this happens the grid either collapses fully or expands fully depending on whether the

<MasterTableView HierarchyDefaultExpanded="true" 

is set or not.

What I want is for the grid to maintain its expanded/collapsed state after rebinding, otherwise the user has to expand collapse the grid again to navigate back to node they were editing before the ReBind() was called.

Is there any way to preserve the state, short of rolling my own code?


Thanks,

Malcolm
Mousumi
Top achievements
Rank 1
 answered on 20 Nov 2015
1 answer
81 views

I have radcontextmenu where some items have custom attribute "ConfirmationMessage" with a value like "Are you sure you want to delete?"  These attributes are set on the server code-behind on load.

On the client in javascript - the OnClientItemClicking event checks that attribute and presents a radconfirm first. 

It works on the first load of the page, but the attributes are lost after ajax/postback. 

Please advise a fix or workaround.  I am already using the Text, Value properties.  Is there some clever way to use the NavigateURL field without causing it to try to navigate to a page?

Thanks

Sean

Compass
Top achievements
Rank 1
 answered on 19 Nov 2015
0 answers
98 views
Is it possible to add rad combo box to file upload window of rad file explorer ?
pavan
Top achievements
Rank 1
 asked on 19 Nov 2015
1 answer
132 views

Hi,

I am currently using rad file explorer in my project. Is it possible to get a popup window onclick of file upload in rad file explorer. And that popup window should consist of two rad combo boxes. once we make selection in rad combo boxes on the rad popup window then user should be able to click on the fie upload popup window. Is it possible in telerik ?

pavan
Top achievements
Rank 1
 answered on 19 Nov 2015
1 answer
81 views

I'm currently changing background colors of days using the following code:

 

Protected Sub calendar_TimeSlotCreated(sender As Object, e As TimeSlotCreatedEventArgs) Handles calendar.TimeSlotCreated
        If ScheduleDates.Contains(e.TimeSlot.Start) Then
            e.TimeSlot.CssClass = "lightSalmon"
        End If
    End Sub

 

Everything works fine except for weekend days. I know for a fact that my ScheduleDates contains weekend dates because I've debugged it. Every day color is being changed but the weekend days remain unaffected. Any ideas?

Nencho
Telerik team
 answered on 19 Nov 2015
1 answer
86 views

Hi,

I have had a combobox for a while that has been populated on the client side using a PageMethod and just manually handling the callbacks etc. to loop through the results and add the items using the .add() function on the item list.  This has worked perfectly for me so far but when I try to turn checkboxes on to make it multi-select, it has slowed right down and the add operation now takes 80-100ms per item which is unacceptable since I have 1000+ items to insert into the combobox.  

Is there anything I can look at to make this faster or maybe some alternative option I can look into rather than what I am doing? I briefly just looked into Load-on-Demand but I noticed it doesn't play well (or at all) with checkboxes which is the whole point of what I'm doing.  And I would like to keep using ​javascript to populate the combobox as it keeps the page more responsive than just wrapping controls in updatepanels and doing everything server side.  Plus then the whole page would need rework and I would like to avoid that if possible. Below is the markup for the combobox.  Again the speed was fine before I enabled checkboxes and as soon as I did, the client add operation started to take ~100ms.

<telerik:RadComboBox ID='cboRoad' runat='server' style='width: 300px;' AllowCustomText="true" EnableTextSelection="true" Filter="Contains" MarkFirstMatch="true" MaxHeight="210px" OnClientBlur="onBlur" CheckBoxes="true" Localization-CheckAllString="All Roads" EnableCheckAllItemsCheckBox="true" Localization-AllItemsCheckedString="All Roads">
    <ExpandAnimation Duration="0" />
    <CollapseAnimation Duration="0" />
</telerik:RadComboBox>

Veselin Tsvetanov
Telerik team
 answered on 19 Nov 2015
1 answer
69 views
I don't have the GridEditFormItem in the page_load event so that I can get the file explorer control and set the view path.  How would I go about doing this?
Eyup
Telerik team
 answered on 19 Nov 2015
3 answers
581 views

Dear All,

 

Here am posting the code i used in radgrid which residing inside update panel..!!The issue is when i click on export to excel which is by default available.The data retreived is not exporting to excel or any other type.Please help me in this.

 Code:

<asp:UpdatePanel ID="updatepanel1" runat="server">
                    <ContentTemplate>


<header align="center">
<h2>Order</h2>
</header>

<div align="center">
                                <asp:ScriptManager ID="ScriptManager1" runat="server">
                                    </asp:ScriptManager>
                                <table width="100%">
                                    <tr align="center">
                                        <td>

                                            <asp:Label ID="Label1" runat="server" Font-Size="Small" Text="From Date : "></asp:Label>

                                            <telerik:RadDatePicker ID="RadDatePickerFrom" Runat="server"  DateInput-DateFormat="yyyy-MM-dd" AutoPostBack="True">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

<DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd" AutoPostBack="True"></DateInput>

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                            </telerik:RadDatePicker>

                                        </td>
                                        <td>

                                            <asp:Label ID="Label2" runat="server" Font-Size="Small" Text="To Date : "></asp:Label>

                                            <telerik:RadDatePicker ID="RadDatePickerTo" Runat="server" Culture="en-GB" AutoPostBack="True" OnSelectedDateChanged="RadDatePickerTo_SelectedDateChanged">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>

<DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd" AutoPostBack="True"></DateInput>

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                            </telerik:RadDatePicker>

                                        </td>
                                        <td>
                                            <asp:Label ID="Label3" runat="server" Font-Size="Small" Text="Location : "></asp:Label>
                                            <telerik:RadComboBox ID="RadComboloc" Runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboloc_SelectedIndexChanged">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" />
                                                    <telerik:RadComboBoxItem runat="server" Text="IMPORT" Value="PS01W01" />
                                                    <telerik:RadComboBoxItem runat="server" Text="LOCAL" Value="PS01W02" />
                                                    <telerik:RadComboBoxItem runat="server" Text="ALL" Value="PS01W01','PS01W02" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                        <td>
                                            <asp:Label ID="Label4" runat="server" Font-Size="Small" Text="Class : "></asp:Label>
                                            <telerik:RadComboBox ID="RadComboBoxclass" Runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBoxclass_SelectedIndexChanged" >
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" />
                                                    <telerik:RadComboBoxItem Text="Mens &amp; Ladies Wear" runat="server" Value="MH" />
                                                         <telerik:RadComboBoxItem runat="server" Text="Kids Wear" Value="JH" />
                                                </Items>
                                               
                                              
                                            </telerik:RadComboBox>
        
                                        </td>
                                        <td>
                                            <asp:Label ID="Label9" runat="server" Font-Size="Small" Text="PI"></asp:Label>
                                            <telerik:RadComboBox ID="RadComboBoxpi" Runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBoxpi_SelectedIndexChanged">
                                                <Items>
                                                    <telerik:RadComboBoxItem runat="server" />
                                                    <telerik:RadComboBoxItem runat="server" Text="WITH PI" Value="WP" />
                                                    <telerik:RadComboBoxItem runat="server" Text="WITH OUT PI" Value="WOP" />
                                                    <telerik:RadComboBoxItem runat="server" Text="ALL" Value="ALL" />
                                                </Items>
                                            </telerik:RadComboBox>
                                        </td>
                                    </tr>
                                                                        
                                  
                                    <tr align="center">
                                        <td>&nbsp;</td>
                                        <td colspan="3">
                                            <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
                                                <ProgressTemplate>
                                                      <img src="images/ajax-loader.gif" alt="" />
                                               <%--     Loading.....--%>
                                                </ProgressTemplate>
                                            </asp:UpdateProgress>
                                        </td>
                                        <td>&nbsp;</td>
                                    </tr>
                                                                        
                                  
                                </table>
            <%--                           </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Button1"  />
                    </Triggers>
                </asp:UpdatePanel>--%>
                                        <telerik:RadGrid ID="Radgrid1" runat="server" ShowFooter="True"  OnNeedDataSource="Radgrid1_NeedDataSource" AllowFilteringByColumn="True" AllowSorting="True" CellSpacing="0" GridLines="None" Skin="WebBlue" AutoGenerateColumns="False" OnDetailTableDataBind="Radgrid1_DetailTableDataBind" EnableHeaderContextMenu="True" OnItemCreated="Radgrid1_ItemCreated"  >
                                            <ExportSettings ExportOnlyData="True" HideStructureColumns="True" IgnorePaging="True" OpenInNewWindow="True">
                                            </ExportSettings>
                                            <ClientSettings EnableRowHoverStyle="true" >
                                                <Scrolling AllowScroll="True" UseStaticHeaders="True"  />
                                            </ClientSettings>
<MasterTableView  AutoGenerateColumns="false" ShowHeadersWhenNoRecords="true" CommandItemDisplay="Top" >
 <%--   <CommandItemTemplate>
          <asp:Button ID="btnExcel" Width="150px" Text="Export To Excel" OnClick="btnExcel_Click"
                                runat="server" />
                        <%--    <asp:Button ID="btnWord" Width="150px" Text="Export To Word" OnClick="btnWord_Click"
                                runat="server" />
                            <asp:Button ID="btnCSV" Width="150px" Text="Export To CSV" OnClick="btnCSV_Click"
                                runat="server" />
                            <asp:Button ID="btnPDF" Width="150px" Text="Export To PDF" OnClick="btnPDF_Click"
                                runat="server" />--%>
   <%-- </CommandItemTemplate>--%>
    
    
    
    
     <CommandItemSettings ExportToPdfText="Export to PDF" />
    
    
    
    <DetailTables >
        

    <telerik:GridTableView ShowFooter="true"  ShowHeadersWhenNoRecords="false" PageSize="20" NoMasterRecordsText="NO RECORDS" CanRetrieveAllData="False" RetrieveAllDataFields="False" RetrieveNullAsDBNull="False" CommandItemDisplay="Top" CommandItemSettings-ShowExportToExcelButton="True" CommandItemSettings-ShowExportToPdfButton="True">
         
            
            
                                              
                                      
            
            
            
            
            
        <CommandItemSettings  ExportToPdfText="Export to PDF" ShowAddNewRecordButton="false" ShowExportToExcelButton="true" /><RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn><ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn><Columns>
                
             
             
                        
                         
             
                  
                  
            <telerik:GridBoundColumn DataField="order_no" HeaderText="OrderNo" AllowFiltering="true" UniqueName="p_order" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"     >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="barcode" HeaderText="Barcode" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"    >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="supp_ref" HeaderText="Supplier Reference" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"    >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="prod_desc" HeaderText="Description" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"    >

          </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="style" HeaderText="Style" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"  AutoPostBackOnFilter="true"   >

          </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="size" HeaderText="Size" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"  AutoPostBackOnFilter="true"   >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="brand" HeaderText="Brand" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"  AutoPostBackOnFilter="true"   >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="unit_cost" HeaderText="Unit Cost" AllowFiltering="true" >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="order_qtypc" Aggregate="Sum" HeaderText="Order Qty" AllowFiltering="true" >

        </telerik:GridBoundColumn><telerik:GridBoundColumn DataField="recieve_qty" Aggregate="Sum" HeaderText="Received Qty" AllowFiltering="true" >

        </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="shortex" Aggregate="Sum" FilterControlAltText="Filter column column" HeaderText="Short-Excess Qty" UniqueName="column">
            </telerik:GridBoundColumn>
        </Columns><SortExpressions>
                
            <telerik:GridSortExpression FieldName="order_no" SortOrder="Descending" /></SortExpressions><EditFormSettings>
                
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn></EditFormSettings></telerik:GridTableView></DetailTables>
     <commanditemsettings exporttopdftext="Export to PDF"  
                              showaddnewrecordbutton="False" showexporttoexcelbutton="True" ShowExportToPdfButton="True" />
     <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
    </RowIndicatorColumn><ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
    </ExpandCollapseColumn><Columns>
        <telerik:GridBoundColumn DataField="p_order" HeaderText="OrderNo" AllowFiltering="true" UniqueName="p_order" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"  >

        </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="pi_no" FilterControlAltText="Filter column4 column" HeaderText="PI NO" UniqueName="column4" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true">
        </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="name" HeaderText="SupplierName" AllowFiltering="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" AutoPostBackOnFilter="true"   >

        </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="location" HeaderText="Location" AllowFiltering="true" >

        </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="entry_date" HeaderText="EntryDate" AllowFiltering="true"  >

        </telerik:GridBoundColumn>

        <telerik:GridBoundColumn DataField="Tqty" Aggregate="Sum" FilterControlAltText="Filter column1 column" HeaderText="Total Order Qty" UniqueName="column1">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="tamount" Aggregate="Sum" FilterControlAltText="Filter column column" HeaderText="Total Amount" UniqueName="column" DataFormatString="{0:n}" >
        </telerik:GridBoundColumn>

        <telerik:GridBoundColumn DataField="recqty" Aggregate="Sum" FilterControlAltText="Filter column2 column" HeaderText="Total Receive Qty" UniqueName="column2">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="recamt" Aggregate="Sum" FilterControlAltText="Filter column3 column" HeaderText="Total Amt " UniqueName="column3">
        </telerik:GridBoundColumn>

    </Columns><EditFormSettings>
        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
        </EditColumn>
    </EditFormSettings></MasterTableView>
                                            <FilterMenu EnableImageSprites="False">
                                            </FilterMenu>
                                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Black">
                                            </HeaderContextMenu>
                                </telerik:RadGrid>
                                    

</div>
<!--<p>Vitae natoque dictum etiam semper magnis enim feugiat convallis convallis
egestas rhoncus ridiculus in quis risus amet curabitur tempor orci penatibus.
Tellus erat mauris ipsum fermentum etiam vivamus eget. Nunc nibh morbi quis 
fusce hendrerit lacus ridiculus.</p>

<div class="row">
<div class="4u">
<article class="item">
<a href="#" class="image fit"><img src="images/pic02.jpg" alt="" /></a>
<header>
<h3>Ipsum Feugiat</h3>
</header>
</article>
<article class="item">
<a href="#" class="image fit"><img src="images/pic03.jpg" alt="" /></a>
<header>
<h3>Rhoncus Semper</h3>
</header>
</article>
</div>
<div class="4u">
<article class="item">
<a href="#" class="image fit"><img src="images/pic04.jpg" alt="" /></a>
<header>
<h3>Magna Nullam</h3>
</header>
</article>
<article class="item">
<a href="#" class="image fit"><img src="images/pic05.jpg" alt="" /></a>
<header>
<h3>Natoque Vitae</h3>
</header>
</article>
</div>
<div class="4u">
<article class="item">
<a href="#" class="image fit"><img src="images/pic06.jpg" alt="" /></a>
<header>
<h3>Dolor Penatibus</h3>
</header>
</article>
<article class="item">
<a href="#" class="image fit"><img src="images/pic07.jpg" alt="" /></a>
<header>
<h3>Orci Convallis</h3>
</header>
</article>
</div>
</div>-->


                        </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Button1"  />
                    </Triggers>
                </asp:UpdatePanel>​

Eyup
Telerik team
 answered on 19 Nov 2015
1 answer
95 views

Hello.

I have a multiselect combobox with checkeboxes. Let assume that variable "options" has value "Dog, cat". My combobox has items "dog", "cat", "pig". I want to by using JS select and check those two values. This code check Dog and cat, but only cat is really selected.

function setValuesInCombobox(options) {
  var controler =$find(getClientIdById(cboBuildingControlName));   
  controler.set_value(options);
  controler.set_text(options);
  var allChoicesFromCbo = controler.get_items()._array; 
  var selectedOptions =  options.split(",");
 
  for(i = 0; i < selectedOptions.length; i++) {
    var building = selectedOptions[i].trim();
    for(j = 0; j < allChoicesFromCbo.length; j++) {       
      var nameOfBuildingInCbo = allChoicesFromCbo[j]._properties._data.value;
      if( nameOfBuildingInCbo == building) {
        allChoicesFromCbo[j]._setChecked(true);
        allChoicesFromCbo[j].select();
      }
    }
  }

Eyup
Telerik team
 answered on 19 Nov 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?