Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
290 views

Hi

I'm trying to use jquery to update a RadCombobox and set its selected index by using RadComboboxItem.Select().

The updating works fine, but when I use RadComboboxItem.Select() where RadComboboxItem.get_index()=0, RadCombobox.get_selectedIndex() returns the old index.

If RadCombobox.get_index()>0 it works fine.

 

 function SetSelection(radCombo, selectedValue) {
radCombo.trackChanges();
radCombo.clearSelection();
var item = radCombo.findItemByValue(selectedValue);
if (item != null) {
item.select();
alert("id=" + radCombo.get_id() + " item.index=" + item.get_index());
radCombo.set_text(item.get_text());
radCombo.set_value(item.get_value());
}
radCombo.updateClientState();
radCombo.commitChanges();
alert("id="+radCombo.get_id()+" selectedValue="+selectedValue+" index=" + radCombo.get_selectedIndex());
}

 

Eyup
Telerik team
 answered on 13 Aug 2015
9 answers
174 views

Hi,

I have a AutoCompleteBox on my page and a rad button. when I look up for a value and click the update button, a bunch of grids get populated. Simple.

The issue I have is when I copy paste the a value (instead of typing and looking it up in the drop down) and then click on the update Button, upon postback AutoCompleteBox text is empty and nothing happens. Another scenario is if I look up for an item A and later copy paste item B, upon clicking the button, value in the AutoCompleteBox goes back to the item A. Basically when I paste a value in the box instead of typing and looking it up its failing.

Hope I made sense. Can any one help me with this? Thanks a lot.

Regards,

srms

Ivan Danchev
Telerik team
 answered on 13 Aug 2015
6 answers
331 views
var imEditor = null;
           function GetEditor() {
               if (!imEditor)
                   imEditor = $find("<%=imgEditor.ClientID %>");
               return imEditor;
           }
 
           function Zoom() {
               var $ = $telerik.$;
               GetEditor().zoomImage(50);

           
}

I use above code block to zoom the image during page load. In which stage I should fire the script? I tried it in page prerender and imageeditor prerender but both are not working. the issue is imgEditor can not be found. 
Vessy
Telerik team
 answered on 13 Aug 2015
5 answers
537 views

Hi, I'm creating docks dynamically in codebehind (c#) and i'm trying to change colors of each dock.

I am able to change Titlebar's background color but seems like i can't change the forecolor.

I think it's because bootstraps css is overwriting it.

Any idea how i can do this in codebehind?

here is part of the code i have:

dock.TitlebarContainer.BackColor = Color.Black;  //works fine

dock.TitlebarContainer.ForeColor = Color.White;  //DOES NOT WORK, inspecting the element, i can see that it is actually set but is getting overwritten by bootstrap

dock.ContentContainer.BackColor = Color.Back;  //works fine

dock.ContentContainer.ForeColor = Color.White;  //works fine

 

I also tried the following:

dock.TitlebarContainer.Style["color"] = "White !important";

Danail Vasilev
Telerik team
 answered on 13 Aug 2015
3 answers
999 views

Hi !

 

I want set a text of a label in the "OnInit" methode of the .cs page. Is it possible ?

 

...
<telerik:RadComboBox runat="server" ID="RadComboBoxPerimetre" ​...>
  <HeaderTemplate>
    <table style="width:100%">
     <tr>
      <td>
        <asp:Label runat="server" ID="​test"></asp:Label>
      </td>
    </tr>
  </table>
</HeaderTemplate>​
...

 

thanks

Jérémy
Top achievements
Rank 1
 answered on 13 Aug 2015
3 answers
210 views

Scenario:

  • "page with modal window for upload multiple file";
  • in modal window there are two async controls:
    • One for browser with Drag&Drop enabled;
    • One for browser with NO Drag&Drop;
    • Each control is show/hide by jquery/CSS

We want:

  • to clear all uploaded/uploading file when user clic on "X" or close button of modal window (open/closed by jquery): but.. how we can find ALL asyncupload controls on the page without using (open/close/function to manage drag/drop are on a file .js !):

var upload1 = $find("<%= RadUpload1.ClientID %>");
var upload2 = $find("<%= RadUpload2.ClientID %>");

  • to disable "Submit" button if there is an uploading file

 

Hristo Valyavicharski
Telerik team
 answered on 13 Aug 2015
1 answer
84 views

Below is my Rad grid which is binding from sever side during Page_Load. But once I clicked the "Edit" command, all rows are seeing as cleared after that post back. My edit command is not inline, but it's showing the results on a separate page section. If I replace this grid with normal asp.net GridView, the rows are retaining for the same operation. This RadGrid is inside a usercontrols(ascx) and this usercontrol is inside a RadAjaxPanel of the container page. It appears like ViewState is not ​retaining for me once using RadGrid. Any suggestions?

<P><telerik:RadGrid runat="server" ID="grdItemEnquiry" Width="95%"
CssClass="gridview1" ShowFooter="false" AllowSorting="true" AllowPaging="true"
PageSize="20" EnableViewState="true" Visible="true"
OnItemDeleted="grdItemEnquiry_OnRowDeleting"
OnItemCommand="grdItemEnquiry_RowCommand"AutoGenerateColumns="false"ShowHeaderWhenEmpty="true"RowStyle-CssClass="alterwhite"OnItemDataBound="grdItemEnquiry_OnRowDataBound"AlternatingRowStyle-CssClass="altergrey"
HeaderStyle-CssClass="tableHeading br"
OnPageIndexChanged="grdItemEnquiry_PageIndexChanging"><BR>                                                      
<ClientSettingsAllowColumnsReorder="true"><BR>                                                             
<ClientEventsOnCommand="rgPublicationResults_Command"/><BR>                                                      
</ClientSettings><BR>                                                      
<MasterTableView><BR>                                                             
<Columns><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="S.No"ItemStyle-Width="3%"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblSRNO"runat="server"Text='<%#Container.ItemIndex +1
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="SerialNo"Visible="false"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblSerialNo"runat="server"Text='<%#Eval("SerialNo")
%>'></asp:Label><BR>                                                                                 
<asp:Label ID="lblItemID"runat="server"Text='<%#Eval("ItemID")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Item Description"
ItemStyle-Width="10%"
ItemStyle-CssClass="breakWord120"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblItemDescr"runat="server"Text='<%#Eval("ItemDesc")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Item Code" ItemStyle-Width="5%"
ItemStyle-CssClass="breakWord120"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblItemCode"runat="server"Text='<%#Eval("ItemCode")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Delivery Location"
ItemStyle-Width="7%"
ItemStyle-CssClass="breakWord120"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblDelLoc"runat="server"Text='<%#Eval("DelLoc")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Major Category" ItemStyle-Width="5%"
ItemStyle-Wrap="true" ItemStyle-CssClass="DisplayNone"
HeaderStyle-CssClass="DisplayNone"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:DropDownList
runat="server"ID="ddlcategory"Width="70px"BackColor="Cornsilk"AutoPostBack="true"OnSelectedIndexChanged="ddlcategory_SelectedIndexChanged"/><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Minor Category" ItemStyle-Width="5%"
ItemStyle-Wrap="true" ItemStyle-CssClass="DisplayNone"
HeaderStyle-CssClass="DisplayNone"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:DropDownList
runat="server"ID="ddlsubcategory"Width="70px"BackColor="Cornsilk"OnSelectedIndexChanged="ddlsubcategory_SelectedIndexChanged"AutoPostBack="true"/><BR>                                                                          
</ItemTemplate><BR>                          
                                          
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="UOM"ItemStyle-Width="4%"ItemStyle-Wrap="true"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblUOM" runat="server"Text='<%#Eval("UOM")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Need By Date" ItemStyle-Width="5%"
ItemStyle-Wrap="true"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblNeedDate"runat="server"Text='<%#Eval("NeedDate")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Quantity/Duration"ItemStyle-Width="3%"ItemStyle-Wrap="true"ItemStyle-HorizontalAlign="Center"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label
ID="lblQuantity"runat="server"Text='<%#Eval("Quantity_Duration")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                          
<FooterTemplate><BR>                                                                                 
<asp:Label ID="lblGTotal"runat="server"Style="font-weight: bold"Text="Grand
Total
 :"></asp:Label><BR>                                                                          
</FooterTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Unit Price" ItemStyle-Width="3%"
ItemStyle-HorizontalAlign="Right"><BR>                                                             
               
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblprice"runat="server"Text='<%# String.Format("{0} {1}",
 Eval("Currency"), Eval("UnitPrice", "{0:0.000}"))
%>'></asp:Label><BR>                                                                                 
<asp:HiddenField
ID="hdnUnitPrice"runat="server"Value='<%#Eval("UnitPrice") %>'
/><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Taxes"ItemStyle-Width="3%"ItemStyle-HorizontalAlign="Right"
Visible="false"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label
ID="lblTaxes"runat="server"></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Conversion Rate" ItemStyle-Width="3%"
ItemStyle-HorizontalAlign="Center"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label
ID="lblConvRate"runat="server"></asp:Label><BR>                                                                                 
<asp:Label ID="lbCurrencyValue"Style="display: none"
runat="server"Text='<%#Eval("Currency")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Total Price(QAR)" ItemStyle-Width="3%"
ItemStyle-Wrap="true"
ItemStyle-HorizontalAlign="Right"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblTotalPrice"Style="text-align: right; width: 70px"
runat="server"ReadOnly="true"Text='<%#Eval("TotalPrice", "{0:#,#.000}")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                          
<FooterTemplate><BR>                                                                          
       <telerik:RadNumericTextBox ID="lblTotal"
Style="text-align: right" runat="server" CssClass="textEntry" ReadOnly="true"
MaxLength="10"><BR>                                                                                        
<NumberFormatDecimalDigits="3"/><BR>                                                                          
        
</telerik:RadNumericTextBox><BR>                                                                          
</FooterTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="File Name" ItemStyle-Width="7%"
ItemStyle-Wrap="true"
ItemStyle-CssClass="breakWord120"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:LinkButton
ID="btnlineattach"OnClientClick="setFileDownLoadToken();"runat="server"ToolTip="View
 File" CommandName="ViewAttach" OnClick="btnviewattach_Click"
Text='<%#Eval("DocTitle") %>' Style="color: #630040 !important;"
Font-Underline="true" ForeColor="Blue"
CommandArgument='<%#Eval("DocumentFilePath")%>'><BR>                                                                                        
<asp:Label runat="server"ID="lblattachpath"Text='<%#Eval("DocTitle")
%>'></asp:Label><BR>                                                                                 
</asp:LinkButton><BR>                                                                          
</ItemTemplate><BR>                                                                          
<ItemStyleWidth="10%"/><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridBoundColumn
DataField="VirtualPath"Visible="false"HeaderText="Description"/><BR>                                                                    
<telerik:GridBoundColumn
DataField="Type"Visible="false"HeaderText="Action"/><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Is Urgent Requisition"
ItemStyle-Width="8%" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center"
Visible="false" ItemStyle-CssClass="hiddencol"
HeaderStyle-CssClass="hiddencol"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label ID="lblIsReqUrgent"runat="server"Text='<%#Eval("IsReqUrgent")
%>'></asp:Label><BR>                                                                    
        
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Future Requirement"
ItemStyle-Width="8%" ItemStyle-Wrap="true" ItemStyle-HorizontalAlign="Center"
Visible="true"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:Label
ID="lblFutureRequirement"runat="server"Text='<%#Eval("FutureRequirement")
%>'></asp:Label><BR>                                                                          
</ItemTemplate><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnItemStyle-Width="3%"HeaderText="Edit"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:ImageButton
ID="btnedit"runat="server"ImageUrl="~/Images/edit1.png"ToolTip="Edit"CommandName="Edit"CommandArgument='<%#Eval("SerialNo")
%>'
TabIndex="19"/><BR>                                                                          
</ItemTemplate><BR>                                                                          
<ItemStyleWidth="3%"HorizontalAlign="Center"></ItemStyle><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                                    
<telerik:GridTemplateColumnHeaderText="Delete"ItemStyle-Width="5%"><BR>                                                                          
<ItemTemplate><BR>                                                                                 
<asp:ImageButton
ID="btnDelete"runat="server"ImageUrl="~/Images/delete.png"ToolTip="Delete"CommandName="Delete"CommandArgument='<%#Eval("ItemID")
%>' OnClientClick="return confirm('Do you really want to delete?');"
/><BR>                                                                          
</ItemTemplate><BR>                                                                          
<ItemStyleHorizontalAlign="Center"Width="5%"></ItemStyle><BR>                                                                    
</telerik:GridTemplateColumn><BR>                                                             
</Columns><BR>                                                      
</MasterTableView><BR>                                               
</telerik:RadGrid></P>

Eyup
Telerik team
 answered on 13 Aug 2015
4 answers
152 views
Hi Telerik Team,

I think I've discovered a bug:

I have a RadPanelBar inside a GridTemplateColumn of a RadGrid, which is itself inside another RadPanelBar, which is inside the NestedViewTemplate of a containing RadGrid's MasterTableView.

Background

I used the NestedViewTemplate of a RadGrid to contain another RadGrid to show child records, because Telerik's default child record view implementation was very difficult to follow for my end users. This was because all the tables at a level were visible at the same time. So I embedded a RadPanelBar inside the NestedViewTemplate of the master RadGrid so that they would only see one RadGrid at a time by expanding/collapsing the RadPanelBar items for each child RadGrid in the NestedViewTemplate. This works beautifully.

Problem

One of the child RadGrids in the RadPanelBar in the NestedViewTemplate has a GridTemplateColumn. This GridTemplate column has a RadPanelBar. The RadPanelBar only has one item in it. It will neither expand nor collapse by clicking on the item header. It will however do so if you click the arrow for the item. Also, an attached OnItemClicked event does not fire.

If I move the RadPanelBar up one level (i.e. outside of the NestedViewTemplate, into a GridTemplateColumn of the master RadGrid), it will expand and collapse normally with only one RadPanelItem in the RadPanelBar. The OnItemClicked event also fires.

The bug (i.e. refusal to expand/collapse & no OnItemClicked event fire) only seems to appear when the RadPanelBar is inside a GridTemplateColumn of a RadGrid that is inside another RadPanelBar that is inside a NestedViewTemplate of a master RadGrid and it only has one RadPanelItem.

...I hope you are following me so far. If not, here's a sample code mockup:

<telerik:RadGrid ID="MasterRadGrid" runat="server">
   <MasterTableView CommandItemDisplay="Bottom">
      <NestedViewTemplate>
         <telerik:RadPanelBar ID="RadPanelBar1" runat="server">
            <Items>
               <telerik:RadPanelItem runat="server" Owner="RadPanelBar1" Text="Child Table 1">
                  <ContentTemplate>
                     <telerik:RadGrid ID="ChildRadGrid1" runat="server">
                        <MasterTableView runat="Server" CommandItemDisplay="Bottom">
                           <Columns>
                              <telerik:GridTemplateColumn HeaderText="Column" UniqueName="Column">
                                 <EditItemTemplate>
                                    <telerik:RadPanelBar ID="RpbColumn" runat="server">
                                       <Items>
                                          <telerik:RadPanelItem runat="server" Owner="RpbColumn">
                                             <!-- Assorted controls. This RadPanelItem won't expand here, unless in MasterRadGrid -->
                                          </telerik:RadPanelItem>
                                       </Items>
                                    </telerik:RadPanelBar>
                                 </EditItemTemplate>
                              </telerik:GridTemplateColumn>
                           </Columns>
                        </MasterTableView>
                     </telerik:RadGrid>
                  </ContentTemplate>
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Owner="RadPanelBar1" Text="Child Table 2">
                  <!--- Another RadGrid -->
               </telerik:RadPanelItem>
               <telerik:RadPanelItem runat="server" Owner="RadPanelBar1" Text="Child Table 3">
                  <!--- Another RadGrid -->
               </telerik:RadPanelItem>
            </Items>
         </telerik:RadPanelBar>
      </NestedViewTemplate>
   </MasterTableView>
</telerik:RadGrid >

If I add another RadPanelItem to the deeply nested RadPanelBar (ID = "RpbColumn" in the above example) and set its ExpandMode = "SinglePanelItem", it will expand & collapse normally. I'm using Telerik v. 2011.3.1115.40.

Can someone please confirm that this is indeed a bug? Thanks in advance.
Denny
Top achievements
Rank 1
 answered on 12 Aug 2015
1 answer
95 views

I am using RadFilter on a page connected to a RadGrid in the simplest way.  The RadGrid built in filter generates a correct filterexpression for use in dynamic linq.  However the RadFilter gets everything correct except for the fact that the field names are prefixed with "it."  

I also decompiled the RadFilter and related code and came across the following code in which it appears that the "it" prefix is very intentional and also very hard-coded.  This is forcing me to put in an event handler to search for the prepended 'it' and remove it.  What is happening here?

 

:

public string FormatFieldName(string fieldName, Type dataType, bool isCaseSensitive)
{
dataType = RadFilterTypeHelper.GetNonNullableType(dataType);
if (dataType == typeof (string))
{
string str = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("iif(it.{0}==null,\"\",it.{0}).ToString(){1}", (object) fieldName, (object) str);
}
if (!(dataType == typeof (char)))
return string.Format("it.{0}", (object) fieldName);
string str1 = isCaseSensitive ? "" : ".ToUpper()";
return string.Format("Char(iif(it.{0}==null,'''',it.{0})).ToString(){1}", (object) fieldName, (object) str1);
}

Charles
Top achievements
Rank 1
 answered on 12 Aug 2015
20 answers
1.0K+ views
Hello!!

I need to allow exporting all the rows of my RadGrid to .CSV, however after i tested the exportToCSV button, it only exports the results of the first page(showed on the webpage).

It's possible to export all the GRID data ?? Can you tell me how?

Another thing I need to know, is how can i export only one column values to a pdf or excell..instead of all the collumns unformatted??
Jayesh Goyani
Top achievements
Rank 2
 answered on 12 Aug 2015
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?