Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
125 views
is there an example somewhere of how to style the open images.  Specifically we want to change from the up/down arrows on the right side of the bar to +/- on the left side?

thank you

David
Princy
Top achievements
Rank 2
 answered on 03 Dec 2012
2 answers
252 views
function RowSelected(sender, args) {

                
                document.getElementById("<%= EmployeeImage.ClientID %>").innerHTML =
                  args.getDataKeyValue("ResourceImage");
              
               }

 <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" ShowFooter="True"
            Style="outline: 0" GroupingEnabled="true" ShowGroupPanel="false" AutoGenerateColumns="False"
            
       
            <MasterTableView ClientDataKeyNames="RecId,ResourceImage" 
                AutoGenerateColumns="false" DataKeyNames="RecId" ShowFooter="true" PagerStyle-Mode="NextPrevAndNumeric" IsFilterItemExpanded="false" >
<columns>
 <telerik:GridBinaryImageColumn DataField="ResourceImage" HeaderStyle-Width="50px" HeaderText="Image" ResizeMode="Fit" 
                                UniqueName="ResourceImage" ImageHeight="30px" ImageWidth="20px" ItemStyle-Wrap="false" >
                            </telerik:GridBinaryImageColumn>
</columns>...

  <telerik:RadBinaryImage ID="EmployeeImage"  runat="server"
                                        Height="50px" Width="50px"  />
          
                
            Help me on this
Andrey
Telerik team
 answered on 03 Dec 2012
8 answers
209 views
Hi I am having a ribbon bar in a master page, I am having a child page where I am having some text boxes, if user enter some data and tries to navigate to another page on clicking the tab of ribbon bar i would like to show a pop up like are you sure you want to navigate with out saving. My javascript is as follows in child page
<script type="text/javascript">
        var isDirty;
        isDirty = 0;
 
        function setDirty() {
            var form = document.getElementById("<%=txt.ClientID %>");
            var v = form.value;
            //is_checked = elems[i].checked;
            //is_checked1 = elems[i].checked;
            if (v == '') {
                isDirty = 0;
                //alert("In");
            }
            else {
                isDirty = 1;
                alert("In");
            }
 
        }
 
        function checkSave() {
            var sSave;
            if (isDirty == 1) {
                sSave = window.confirm("You have some changes that have not been saved. Click OK to save now or CANCEL to continue without saving.");
                if (sSave == true) {
                }
                else {
                }
            }
        }
    </script>

On change tab event i would like to fire that alert, from child page can some one help me

Also how can I get all RibbonBarTab,RibbonBarGroup and associated RibbonBarButton through looping in javascript
Princy
Top achievements
Rank 2
 answered on 03 Dec 2012
1 answer
135 views
Hi
I am having troubles with the Count Aggregate. 
I have a radgrid with several levels. You can see it on the picture 


The problems is that for the first level. I have right the information.

First Level Company BATCA
 Departamento FINANZAS; Empleados: 218; Costo $14,110.00
 Carnet CONTRATISTA; Empleado_Carnets: 19; Costo $1,235.00
 Carnet HORAS EXTRAS; Empleado_Carnets: 20; Costo $1,270.00
  Carnet PERMANENTE; Empleado_Carnets: 20; Costo $1,300.00 (... group continued from the previous page. Showing     163 of 20 items. Group continues on the next page.) This information is correct, but still I don't understand why it shows me 20 in Empleados_Carnets instead of 163
 Carnet PRACTICANTE; Empleado_Carnets: 16; Costo $1,040.00

Second Level Company TAHSA

This information is completely wrong. This is the same of the first level Company BATCA
 Departamento FINANZAS; Empleados: 218; Costo $14,110.00
 Carnet PERMANENTE; Empleado_Carnets: 163; Costo $10,565.00
 Carnet PRACTICANTE; Empleado_Carnets: 16; Costo $1,040.00
 Carnet VISITA; Empleado_Carnets: 15; Costo $975.00
 

The aspx code is the following

<telerik:RadScriptManager runat="server" ID="RadScriptManager1"></telerik:RadScriptManager>
       <form id="Form1" method="post" runat="server">
           <TABLE id="Table4" style="Z-INDEX: 101; LEFT: 40px; POSITION: absolute; TOP: 40px; BORDER-COLLAPSE: collapse"
               height="99%" cellSpacing="1" cellPadding="1" width="95%" border="0">
               <TR>
                   <TD vAlign="top" align="left">
                       <TABLE id="Table1" style="BORDER-COLLAPSE: collapse" cellSpacing="1" cellPadding="1" width="300"
                           border="1">
                           <TR>
                               <TD align="center" background="..\imagenes\titulos2.jpg"><asp:label id="Label3" runat="server" Height="100%" Width="474px" CssClass="text">Tipo de Carnet</asp:label></TD>
                           </TR>
                           <TR>
                               <TD>
                                   <TABLE id="Table2" height="100%" cellSpacing="1" cellPadding="1" width="100%" border="0">
                                       <TR>
                                           <TD noWrap><asp:label id="Label4" runat="server" CssClass="label1">Fecha Inicio</asp:label></TD>
                                           <TD style="WIDTH: 226px">
                                               <cc1:livetextbox id="fechain" runat="server" CssClass="flat">10/09/2006</cc1:livetextbox><IMG id="Img2" onclick="javascript:fPopCalendar(fechain,fechain,1,4,'/')" alt="" src="..\imagenes\calendar.png"></TD>
                                           <TD noWrap><asp:label id="Label1" runat="server" CssClass="label1">Fecha Fin</asp:label></CC1:LIVELABEL></TD>
                                           <TD noWrap>
                                               <cc1:livetextbox id="fechafin" runat="server" CssClass="flat">10/09/2006</cc1:livetextbox><IMG id="Img1" onclick="javascript:fPopCalendar(fechafin,fechafin,1,4,'/')" alt="" src="..\imagenes\calendar.png"></TD>
                                       </TR>
                                   </TABLE>
                               </TD>
                           </TR>
                           <TR>
                               <TD><asp:button id="Button2" runat="server" CssClass="gridupdate" ToolTip="Aceptar"
                                       onclick="Button2_Click1"></asp:button>
                                   <asp:button id="Button1" runat="server" CssClass="excel" ToolTip="Exportar a Excel"></asp:button></TD>
                           </TR>
                       </TABLE>
                       <telerik:radgrid id="RadGrid1" runat="server" ShowGroupPanel="True" AllowSorting="True" CssClass="Windows7" Skin="Windows7" >
                           <PagerStyle CssClass="GridPager_Default" ></PagerStyle>
                           <AlternatingItemStyle CssClass="GridAltRow_Default"></AlternatingItemStyle>
                           <GroupHeaderItemStyle CssClass="GroupHeader_Default"></GroupHeaderItemStyle>
                           <FilterMenu NotSelectedImageUrl="~/RadControls/Grid/Skins/Default/NotSelectedMenu.gif" HoverBackColor="LightSteelBlue"
                               HoverBorderColor="Navy" SelectColumnBackColor="Control" SelectedImageUrl="~/RadControls/Grid/Skins/Default/SelectedMenu.gif"
                               TextColumnBackColor="Window"></FilterMenu>
                           <MasterTableView CssClass="MasterTable_Default">
                               <RowIndicatorColumn UniqueName="RowIndicator" Visible="False">
                                   <HeaderStyle Width="20px" CssClass="ResizeHeader_Default"></HeaderStyle>
                                   <ItemStyle CssClass="ResizeItem_Default"></ItemStyle>
                               </RowIndicatorColumn>
                               <EditFormSettings>
                                   <EditColumn UniqueName="EditCommandColumn"></EditColumn>
                               </EditFormSettings>
                               <ExpandCollapseColumn ButtonType="ImageButton" UniqueName="ExpandColumn" Visible="False">
                                   <HeaderStyle Width="19px"></HeaderStyle>
                               </ExpandCollapseColumn>
                           </MasterTableView>
                           <HeaderStyle CssClass="GridHeader_Default"></HeaderStyle>
                           <SelectedItemStyle CssClass="SelectedRow_Default"></SelectedItemStyle>
                           <ActiveItemStyle CssClass="ActiveRow_Default"></ActiveItemStyle>
                           <ItemStyle CssClass="GridRow_Default"></ItemStyle>
                           <FooterStyle CssClass="GridFooter_Default"></FooterStyle>
                           <ClientSettings AllowExpandCollapse="True" AllowRowHide="True" AllowDragToGroup="True" AllowGroupExpandCollapse="True">
                               <Resizing AllowColumnResize="True"></Resizing>
                           </ClientSettings>
                           <GroupPanel Visible="True">
                               <PanelStyle CssClass="GroupPanel_Default"></PanelStyle>
                               <PanelItemsStyle CssClass="GroupPanelItems_Default"></PanelItemsStyle>
                           </GroupPanel>
                       </telerik:radgrid></TD>
               </TR>
               <TR>
                   <TD vAlign="bottom" align="right"><cc1:liveimage id="LiveImage1" runat="server" Height="218px" Width="305px" ImageUrl="..\imagenes\fondo2.jpg"></cc1:liveimage></TD>
               </TR>
           </TABLE>
       </form>



The c# code is the following


private void Page_Load(object sender, System.EventArgs e)
        {
            if(!IsPostBack)
            {
                this.fechain.Text="01"+DateTime.Now.ToString("/MMM/yyyy");
                this.fechafin.Text=DateTime.Now.ToString("dd/MMM/yyyy");
       
 
                GridGroupByExpression expression = new GridGroupByExpression();
 
                GridGroupByField gridGroupByField = new GridGroupByField();
             
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "EMPRESA";
                gridGroupByField.HeaderText = "Empresa";
                gridGroupByField.HeaderValueSeparator = " ";
                gridGroupByField.FormatString = "<strong>{0}</strong>";
                expression.SelectFields.Add( gridGroupByField );
                 
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "CODIGO";
                gridGroupByField.HeaderText = "Empleados";
                gridGroupByField.Aggregate = GridAggregateFunction.Count;
                expression.SelectFields.Add( gridGroupByField );
 
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "Total";
                gridGroupByField.HeaderText = "Costo ";
                gridGroupByField.HeaderValueSeparator = "";
                gridGroupByField.FormatString ="{0:C}";
                gridGroupByField.Aggregate = GridAggregateFunction.Sum;
                expression.SelectFields.Add( gridGroupByField );
 
                //Add a filed for group-by (after the "Group By" clause)
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "EMPRESA";
                expression.GroupByFields.Add( gridGroupByField );
 
                this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression );
                 
 
                GridGroupByExpression expression1 = new GridGroupByExpression();
 
                 
                GridGroupByField gridGroupByField1 = new GridGroupByField();
 
                gridGroupByField1 = new GridGroupByField();
                gridGroupByField1.FieldName = "DEPARTAMENTO";
                gridGroupByField1.HeaderText = "Departamento";
                gridGroupByField1.HeaderValueSeparator = " ";
                gridGroupByField1.FormatString = "<strong>{0}</strong>";
                expression1.SelectFields.Add( gridGroupByField1 );
                 
                gridGroupByField1 = new GridGroupByField();
                gridGroupByField1.FieldName = "CODIGO";
                gridGroupByField1.HeaderText = "Empleados";
                gridGroupByField1.Aggregate = GridAggregateFunction.Count;
                expression1.SelectFields.Add( gridGroupByField1 );
 
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "Total";
                gridGroupByField.HeaderText = "Costo ";
                gridGroupByField.HeaderValueSeparator = "";
                gridGroupByField.FormatString ="{0:C}";
                gridGroupByField.Aggregate = GridAggregateFunction.Sum;
                expression1.SelectFields.Add( gridGroupByField );
 
                //Add a filed for group-by (after the "Group By" clause)
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "DEPARTAMENTO";
                expression1.GroupByFields.Add( gridGroupByField );
 
                this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression1 );
               
 
                GridGroupByExpression expression2 = new GridGroupByExpression();
 
                 
                GridGroupByField gridGroupByField2 = new GridGroupByField();
 
                gridGroupByField2 = new GridGroupByField();
                gridGroupByField2.FieldName = "CARNET";
                gridGroupByField2.HeaderText = "Carnet";
                gridGroupByField2.HeaderValueSeparator = " ";
                gridGroupByField2.FormatString = "<strong>{0}</strong>";
                expression2.SelectFields.Add( gridGroupByField2 );
                 
                gridGroupByField2 = new GridGroupByField();
                gridGroupByField2.FieldName = "CODIGO";
                gridGroupByField2.HeaderText = "Empleado_Carnets";
                gridGroupByField2.Aggregate = GridAggregateFunction.Count;
                expression2.SelectFields.Add( gridGroupByField2 );
 
 
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "Total";
                gridGroupByField.HeaderText = "Costo ";
                gridGroupByField.HeaderValueSeparator = "";
                gridGroupByField.FormatString ="{0:C}";
                gridGroupByField.Aggregate = GridAggregateFunction.Sum;
                expression2.SelectFields.Add( gridGroupByField );
 
                //Add a filed for group-by (after the "Group By" clause)
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "CARNET";
                expression2.GroupByFields.Add( gridGroupByField );
 
                this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression2 );
                 
               
 
                GridGroupByExpression expression3 = new GridGroupByExpression();
 
                 
                GridGroupByField gridGroupByField3 = new GridGroupByField();
 
                gridGroupByField3 = new GridGroupByField();
                gridGroupByField3.FieldName = "JORNADA";
                gridGroupByField3.HeaderText = "Jornada";
                gridGroupByField3.HeaderValueSeparator = " ";
                gridGroupByField3.FormatString = "<strong>{0}</strong>";
                expression3.SelectFields.Add( gridGroupByField3 );
                 
                gridGroupByField3 = new GridGroupByField();
                gridGroupByField3.FieldName = "CODIGO";
                gridGroupByField3.HeaderText = "Empleados_Tipo";
                gridGroupByField3.Aggregate = GridAggregateFunction.Count;
                expression3.SelectFields.Add( gridGroupByField3 );
 
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "Total";
                gridGroupByField.HeaderText = "Costo ";
                gridGroupByField.HeaderValueSeparator = "";
                gridGroupByField.FormatString ="{0:C}";
                gridGroupByField.Aggregate = GridAggregateFunction.Sum;
                expression3.SelectFields.Add( gridGroupByField );
 
                //Add a filed for group-by (after the "Group By" clause)
                gridGroupByField = new GridGroupByField();
                gridGroupByField.FieldName = "JORNADA";
                gridGroupByField.SortOrder=Telerik.Web.UI.GridSortOrder.Ascending;
  
                expression3.GroupByFields.Add( gridGroupByField );
                   
 
 
                this.RadGrid1.MasterTableView.GroupByExpressions.Add( expression3 );
                this.RadGrid1.MasterTableView.GroupsDefaultExpanded=false;
 
  
 
 
            }
        }


Thanks for your help.
Andrey
Telerik team
 answered on 03 Dec 2012
2 answers
324 views
Hi All,
I want to open a PDF file in a  Rad Window.I have gone through some forum replies and unfortunately in almost all replies the solution is to set the below 2 properties in RadWindow.
VisibleOnPageLoad="true" ShowContentDuringLoad="true".

If I set VisibleOnPageLoad property , as name suggests when the parent page loads RadWindow will also get displayed.
My requirement is when the parant page loads,RadWindow should be hidden and when I click on a link Radwindow should open with the PDF.

RadWindow Code:
  <telerik:RadWindow ID="TestWindow" runat="server" EnableEmbeddedSkins="True" Skin="Windows7" 
                   Modal="True" Width="900" Height="500" KeepInScreenBounds="True" Overlay="True" 
                   DestroyOnClose="false" VisibleStatusbar="false" VisibleTitlebar="true" 
                    ShowContentDuringLoad="true"
                   >
                    <ContentTemplate>
                                               
                    </ContentTemplate>
                  </telerik:RadWindow>

I am opening Radwindow using javascript code

 function showRadWnd() {
                         window.radopen("RadExport.pdf", "Test");
                        return false;
        }
Please help me.

A2H
Top achievements
Rank 1
 answered on 03 Dec 2012
1 answer
790 views
I'm attempting to use client side API to hide the title, another way i'm trying to do it is by setting the title attribute to false and neither are working. 

 function launchRadWindow(url)
    {
        var oWnd = $find("<%= DialogWindow.ClientID %>");
        oWnd.show();
        oWnd.setSize(640, 480);
        oWnd.setUrl(url);
        oWnd.minimize();
        oWnd.maximize();
        oWnd.restore();
        
    }
<telerik:RadWindow VisibleOnPageLoad="False" ID="DialogWindow" runat="server" Height="480px" Width="640px" VisibleStatusbar="False" NavigateUrl="false" IconUrl="false" Skin="Default" Behaviors="Close, Minimize, Maximize, Move, Resize" Overlay="True"> </telerik:RadWindow>
Princy
Top achievements
Rank 2
 answered on 03 Dec 2012
3 answers
173 views
Hi,

I have a screen that will give search result ( Invoice no(s) ) and need to be binding in check box list.

this is the check box that i added in aspx page. but  I would like to show dynamically based on search result ( no of invoice no(s))

  <asp:TableCell CssClass="fls">
<telerik:RadButton ID="chkSearchResult" ToggleType="CheckBox" runat="server" Text="HQ09504">
       <ToggleStates>
            <telerik:RadButtonToggleState Text="HQ09504" PrimaryIconCssClass="rbToggleCheckboxChecked" />
           <telerik:RadButtonToggleState Text="HQ09504" PrimaryIconCssClass="rbToggleCheckbox" />
      </ToggleStates>
</telerik:RadButton>
</asp:TableCell>

Please give me sample code to generate check boxes at run time.

Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 03 Dec 2012
3 answers
290 views
I have a data bound combobox. How can I set the selected value to the last item from my database?

Thanks, Marty
Princy
Top achievements
Rank 2
 answered on 03 Dec 2012
1 answer
255 views
I am using two columns in my EditFormSettings, and I want to set the width of the text box on the edit to 90%.  I have tried using  multiple properties on the ItemStyle, like ItemStyle-CssClass="NameOfCssClassThatHas90%Width" and ItemStyle-Width="90%" without any success.  The textbox that shows up only has about 40% width.

Any Suggestions?  As I have about 20 controls in the edit form, using a code-behind isn't my preferred method, and I didn't see how to use a ColumnEditor Class.  Can one columneditor class be attached to multiple GridBoundColumns?

I am trying to create a professional looking application, and without changing that width, it just doesn't look good.

Here is my code for the column, if you are interested.  You will notice this is an "email" type form.

 

 

<telerik:GridBoundColumn DataField="cRegarding" EditFormColumnIndex="0" MaxLength="150"

 

 

 

FilterControlAltText="Filter cRegarding column" HeaderText="Subject"

 

 

 

SortExpression="cRegarding" UniqueName="cRegarding" ></telerik:GridBoundColumn>

 

Shinu
Top achievements
Rank 2
 answered on 03 Dec 2012
21 answers
1.0K+ views
I have a RadGrid that i'm putting into default edit mode following the documentation here: http://www.telerik.com/help/aspnet/grid/grddefaulteditmodeforgriditemsoninitialload.html

Everything works great, except when I have a GridHyperlinkColumn. I will get the error: Column 'FileName' does not belong to table DefaultView.
My HyerlinkColumn code looks like this:
<telerik:GridHyperLinkColumn HeaderText="View Hyperlink" DataTextFormatString="View Hyperlink"
                   DataNavigateUrlFields="FileName" UniqueName="FileName2" DataNavigateUrlFormatString="http://www.xyz.com/{0}"
                   ShowFilterIcon="false" DataTextField="FileName" AllowFiltering="false" >
               </telerik:GridHyperLinkColumn>


protected void RadGrid1_PreRender(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        foreach (GridItem item in RadGrid1.MasterTableView.Items)
        {
            if (item is GridEditableItem)
            {
                GridEditableItem editableItem = item as GridDataItem;
                editableItem.Edit = true;
            }
        }
        RadGrid1.Rebind(); // It fails with the error here, when the Grid is rebinding.
    }

The error will fail when the grid is rebinding. I'm assuming it's trying to put the HylinkColumn into edit mode, but I don't know enough about the RadGrid to tell it to skip it in the foreach loop.
Alan
Top achievements
Rank 1
 answered on 03 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?