Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
55 views
Dear,

We use the rad grid with a context menu (which works fine). Now we should be
able to make the context menu dependable on the clicked row. Fe, we have a
status field in the grid. If the status field equals 'pending' we should see 3
options. If the status filed equals completed we should see 4 menu options, if
the status field is null we should see one option.

Is this achievable with the context menu? If yes, how can we do this?

Thx!

MDS
Top achievements
Rank 1
 answered on 21 Feb 2014
10 answers
300 views
Hi,

I have been using Twitter Bootstrap 2.3.2 and 3.0  on one of the  asp.net web application. Are Telerik controls
responsive to different devices from Mobile, Tablet?  



My company owns Telerik
AJAX UI controls which they just renewed and wondering if using Telerik control
will work with Bootstrap and be responsive to different devices?



Thanks

Ivan Zhekov
Telerik team
 answered on 21 Feb 2014
4 answers
223 views
Hi,

I have a RadGrid in batch mode that contains a RadComboBox inside the EditTemplate.  If I change the options checked inside the ComboBox, in the first row,  those changes persist in the following rows in editmode, even when I´m assigning different checks inside each of the rows in client side scripts.  SO for example if I uncheck the option for XML, PDF and HTM in the combobox in the first row, and then I try to edit the second row, those options are uncheck, when they should be check, since is a new row, and I'm initializing the combobox values with a hiddenfield.

Grid
<telerik:GridTemplateColumn HeaderText="File Prefix" HeaderStyle-Width="280px" UniqueName="Fileprefix">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lbChapterFilePrefix">Prefix</asp:Label>
                                    (<asp:Label runat="server" ID="lblFileTypeXML">xml</asp:Label>,
                                    <asp:Label runat="server" ID="lblFileTypePDF">pdf</asp:Label>,
                                    <asp:Label runat="server" ID="lblFileTypeHTM">html</asp:Label>)
                                    <asp:HiddenField runat="server" ID="hdCurrentFileTypes" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label runat="server" ID="lbFilePrefix">prefix</asp:Label>
                                    <telerik:RadComboBox Skin="Outlook" runat="server" ID="cbFileType" CheckBoxes="true"
                                        AllowCustomText="false" CheckedItemsTexts="DisplayAllInInput" >
                                        <Items>
                                            <telerik:RadComboBoxItem Text="xml" Value="xml" />
                                            <telerik:RadComboBoxItem Text="pdf" Value="pdf" />
                                            <telerik:RadComboBoxItem Text="htm" Value="htm" />
                                        </Items>
                                    </telerik:RadComboBox>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>

JS

<script type="text/javascript" language="javascript">
 
    function SaveGridChanges(sender, args) {
        var grid = $find("<%= rgBookManagement.ClientID  %>");
        grid.get_batchEditingManager().saveChanges(grid.get_masterTableView());
    }
 
    function GetCellValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
            args.set_cancel(true);
            var container = args.get_container();
            //debugger;
            var chapterPrefix = $telerik.findElement(container, "lbChapterFilePrefix").innerHTML;
            var isFileTypeXML = ($telerik.findElementcontainer, "hdCurrentFileTypes").value.toLowerCase().indexOf("xml") >= 0 ? true : false);
            var isFileTypePDF = ($telerik.findElement(container, "hdCurrentFileTypes").value.toLowerCase().indexOf("pdf") >= 0 ? true : false);
            var isFileTypeHTM = ($telerik.findElement(container, "hdCurrentFileTypes").value.toLowerCase().indexOf("htm") >= 0 ? true : false);
            args.set_value(new Prefix(chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM));
        }
    }
 
    function SetCellValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
              args.set_cancel(true);
              var container = args.get_container();
              value = args.get_value(),
              isFileTypeXML = value.isFileTypeXML,
              isFileTypePDF = value.isFileTypePDF
              isFileTypeHTM = value.isFileTypeHTM;
              //debugger;
              $telerik.findElement(container, "lblFileTypeXML").style.color = (isFileTypeXML == true ? 'black' : 'red');
              $telerik.findElement(container, "lblFileTypePDF").style.color = (isFileTypePDF == true ? 'black' : 'red');
              $telerik.findElement(container, "lblFileTypeHTM").style.color = (isFileTypeHTM == true ? 'black' : 'red');
        }
    }
 
    function GetEditorValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
              args.set_cancel(true);
              var container = args.get_container();
              var combo = $telerik.findControl(container, "cbFileType");
 
              isFileTypeXML = combo.get_items().getItem(0).get_checked();
              isFileTypePDF = combo.get_items().getItem(1).get_checked();
              isFileTypeHTM = combo.get_items().getItem(2).get_checked();
              //debugger;
              chapterPrefix = $telerik.findElement(container, "lbFilePrefix").innerHTML;
              args.set_value(new Prefix(chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM));
        }
    }
 
    function SetEditorValue(sender, args) {
        if (args.get_columnUniqueName() === "Fileprefix") {
            args.set_cancel(true);
            var container = args.get_container();
            var value = args.get_value();
            chapterPrefix = value.chapterPrefix,
            isFileTypeXML = value.isFileTypeXML,
            isFileTypePDF = value.isFileTypePDF,
            isFileTypeHTM = value.isFileTypeHTM;
 
            $telerik.findElement(container, "lbFilePrefix").innerHTML = chapterPrefix;
            var combo = $telerik.findControl(args.get_container(), "cbFileType");
 
            combo.trackChanges();
            //debugger;
            //Check Fields
            combo.get_items().getItem(0).set_checked(isFileTypeXML == true);
            combo.get_items().getItem(1).set_checked(isFileTypePDF == true);
            combo.get_items().getItem(2).set_checked(isFileTypeHTM == true);
 
            combo.commitChanges();
        }
    }
 
    var Prefix = function (chapterPrefix, isFileTypeXML, isFileTypePDF, isFileTypeHTM) {
        this.chapterPrefix = chapterPrefix;
        this.isFileTypeXML = isFileTypeXML;
        this.isFileTypePDF = isFileTypePDF;
        this.isFileTypeHTM = isFileTypeHTM;
    }
 
</script>



<ClientSettings><ClientEvents OnBatchEditGetCellValue="GetCellValue" OnBatchEditGetEditorValue="GetEditorValue"                            OnBatchEditSetCellValue="SetCellValue" OnBatchEditSetEditorValue="SetEditorValue" />                 
<ClientSettings><ClientEvents OnBatchEditGetCellValue="GetCellValue" OnBatchEditGetEditorValue="GetEditorValue"                            OnBatchEditSetCellValue="SetCellValue" OnBatchEditSetEditorValue="SetEditorValue" />                 
Viktor Tachev
Telerik team
 answered on 21 Feb 2014
1 answer
103 views

We have recently implemented the latest version of the RadControls to address issues using the Editor in Chrome. We are using the RadControls in DotNetNuke 7. For the most part, everything seems to be working okay now, however we are having an issue when selecting images in the Image Manager to insert into the Editor. When we click on the image, the Image Manager window closes but the selected image doesn't appear in the Editor. We are seeing a JavaScript error: 

Uncaught TypeError: Object [object Array] has no method 'cloneNode'  - jquery.js:9597

CloneNode seems to be called in the following method:

  case "ImageManager":
            var callbackFunction = function (sender, args) {
                //result holds the image element   
                var result = Telerik.Web.UI.Editor.Utils.getOuterHtml(args.get_value());
                var div = document.createElement("DIV");
                Telerik.Web.UI.Editor.Utils.setElementInnerHtml(div, result);

                //First child must be the image!    
                var img = div.firstChild;
                div.style.overflow = "hidden";
                div.style.width = "1px";
                div.style.height = "1px";

                document.body.appendChild(div);
                //GET THE INSERTED IMAGE WIDTH AND HEIGHT    
                //alert(img.offsetWidth + " -- " + img.offsetHeight);
                img.width = img.offsetWidth;
                img.height = img.offsetHeight;

                editor.pasteHtml(div.innerHTML, "ImageManager");
            };

Any ideas what might be causing this issue? Should the full RadControls work properly in the DNN environment?  












jquery.js:9597
jquery.js:9597
jquery.js:9597
Ianko
Telerik team
 answered on 21 Feb 2014
3 answers
174 views
I have a RadGrid and I want to trigger the OnRowSelected ClientEvent if ther is only one row in the result set after the client side grid data bind.
The following code was working before upgrading to version 2013.3.1324.45

    var resultTable = $('div[id$=RadGrid1]').find('tbody');
    var hasSingleRecord = $('tr', resultTable).length == 2;
    if (hasSingleRecord) {
        resultTable.find('tr:last').click();
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 21 Feb 2014
3 answers
305 views
Hi.

I am trying to get my x-Axis such that it skips a few days on the labels, such as on RadHTMLChart demo page.  Please advise on how I can achieve this.  Below is a snippet of my code currently.

I get the data from a list containing values and dates.

chrtPerformance.PlotArea.Series.Clear();
chrtPerformance.PlotArea.XAxis.Type = AxisType.Date;
chrtPerformance.PlotArea.XAxis.BaseUnit = DateTimeBaseUnit.Months;
chrtPerformance.PlotArea.XAxis.LabelsAppearance.DataFormatString = "m";
chrtPerformance.PlotArea.XAxis.LabelsAppearance.RotationAngle = 270;
chrtPerformance.PlotArea.XAxis.DataLabelsField = "BatchDate";
 
string type = Settings[NTConstants.CONST_CHART_TYPE].ToString();
if (type == "Area")
{
    var seriesA = new AreaSeries();
    var seriesB = new AreaSeries();
    seriesA.DataFieldY = "CashValue";
    seriesB.DataFieldY = "InstrumentValue";
    seriesA.TooltipsAppearance.ClientTemplate = "#=dataItem.CashValue#, Cash Value";
    seriesB.TooltipsAppearance.ClientTemplate = "#=dataItem.InstrumentValue#, Instrument Value, #=dataItem.BatchDate#";
    seriesA.LabelsAppearance.Visible = false;
    seriesB.LabelsAppearance.Visible = false;
    seriesA.MissingValues = MissingValuesBehavior.Interpolate;
    seriesB.MissingValues = MissingValuesBehavior.Interpolate;
    chrtPerformance.PlotArea.Series.Add(seriesA);
    chrtPerformance.PlotArea.Series.Add(seriesB);
}

Any and all help will be greatly appreciated.

Kind regards.
Leon
Danail Vasilev
Telerik team
 answered on 21 Feb 2014
3 answers
98 views
Hello Friends,

In File Explorer control Grid i go from main directory to sub directory from there i go another directory of sub directory
Like Main directory => Sub Directory => another directory of Sub Directory

When i press back button it go back to Sub Directory
Now i press back button second time it not go back to main directory it remain on same directory


///////////code.cs/////////


        FileExpDocument.ToolBar.Items[0].Visible = true;
        FileExpDocument.ToolBar.Items[1].Visible = false;
        FileExpDocument.ToolBar.Items[2].Visible = false;
        FileExpDocument.ToolBar.Items[9].Visible = false;
        FileExpDocument.ToolBar.Items[6].Visible = false;

       FileExpDocument.ToolBar.OnClientButtonClicked = "OnClientButtonClieck";


///////end///////////////

Here is only Toolbar control related code
in this "OnClientButtonClieck" just set the height of grid and div

when i click first time back button the page_init and Page_load all event fire
But when i click second time no event fire nothing happen


Please help me it is very urgent 
Vessy
Telerik team
 answered on 21 Feb 2014
1 answer
38 views
Hi,
 
I'm using radgrid with with footer containing a textbox which rows are added dynamically in code behind. My problem is while printing the radgrid some of the contents in the textbox should be printed in second page or following page but its not printing and printing a blank page. Following is the code.

Can somebody please help me.
<telerik:GridTemplateColumn UniqueName="Template1" HeaderText="Description">
                                    <ItemTemplate>
                                        
                                        <asp:Label runat="server" ID="lbldesc" Text='<% #Eval("ITEM_DESCRIPTION") %>' />
                                    </ItemTemplate>
                                        <FooterTemplate>
                                            <asp:TextBox runat="server" ID="txt" TextMode="MultiLine" Width="95%" style="overflow:hidden" ReadOnly="true" AutoPostBack="false" ></asp:TextBox>
                                            
                                        </FooterTemplate>
                                    </telerik:GridTemplateColumn>

function OnClientClicked(button, args) {
                debugger
                var previewWnd = window.open('about:blank', '', '', false);
                var sh = '<%= ClientScript.GetWebResourceUrl(rdgrdResults.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",rdgrdResults.Skin)) %>';
               
                var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
                var htmlcontent = styleStr + "<body>" + $find('<%= rdgrdResults.ClientID %>').get_element().outerHTML + "</body></html>";
              
                previewWnd.document.open();
                previewWnd.document.write(htmlcontent);
                previewWnd.document.close();
                previewWnd.print();
                previewWnd.close();
            }
Kostadin
Telerik team
 answered on 21 Feb 2014
24 answers
2.2K+ views
Hello,

I am trying to create two outside buttons that will collapse and expand rows and detail table rows in a radgrid.

I only need to expand/collapse the rows in the master table and the first nested detail grid table. Here is what I have so far:

<asp:Table runat="server" CellPadding="0" CellSpacing="0">
    <asp:TableRow>
        <asp:TableCell>
            <b><asp:LinkButton runat="server" Text="Collapse All" ID="CollapseAllBtn" OnClick="CollapseAllClick" /></b>
        </asp:TableCell>
        <asp:TableCell style="padding-left:10px">
            <b><asp:LinkButton runat="server" Text="Expand All" ID="ExpandAllBtn" OnClick="ExpandAllClick" /></b>
        </asp:TableCell>
    </asp:TableRow>
</asp:Table>


Code behind:
protected void CollapseAllClick(object sender, EventArgs e)
      {
          foreach (GridDataItem item in PNLViewGrid.MasterTableView.Items)
          {
              item.Expanded = false;
              foreach (GridDataItem nestedItem in item.ChildItem.NestedTableViews[0].Items)
              {
                  nestedItem.Expanded = false;
              }
          }
      }
 
      protected void ExpandAllClick(object sender, EventArgs e)
      {
          foreach (GridDataItem item in PNLViewGrid.MasterTableView.Items)
          {
              item.Expanded = true;
              foreach (GridDataItem nestedItem in item.ChildItem.NestedTableViews[0].Items)
              {
                  nestedItem.Expanded = true;
              }
          }
      }

When i click on either of the buttons i get a javascript error. Can someone tell me how to get this to work?

Thanks
Kostadin
Telerik team
 answered on 21 Feb 2014
1 answer
50 views
Hi,

I am new to telerik controls.  We are using  RadControls for ASP.net AJAX Q2 2009.
In one of the page, I am poppingup a window using a ModalPopupExtender.
The modalpopup window  has buttons which postsback. Since I don;t want to post pack the whole page, 
I decided to put it within the updatepanel.  Now It starts giving me error in IE.  But it works fine with Firefox.
The error I get is in Telerik   js.
c.get_request()._get_eventHandlerList()._list.completed.reverse();

Does anyone know how to fix this issue.

By the way I am using VS 2008 3.5,    AjaxControlToolKit 3.5

Thanks
Ravi
subrat nayak
Top achievements
Rank 1
 answered on 21 Feb 2014
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?