Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
127 views
How can I change the colour of the unfilled portion of the progress bar? Also, is it possible to have square corners of the bar?
Marin Bratanov
Telerik team
 answered on 11 Oct 2018
2 answers
147 views

Hi,

1. Can we add our own controls, like textbox, buttons etc.. to Ribbon Bar.

2. How can i execute a javascript fuction on a button click of ribbon bar.

 

Thanks.

Saifulla
Top achievements
Rank 1
 answered on 11 Oct 2018
2 answers
81 views

Hi, i am trying to generate a dynamic table based on user input. For that i am using Ribbonbar.

Markup:

<telerik:RadRibbonBar RenderMode="Lightweight" ID="RadRibbonBar1" runat="server" Skin="Office2007" EnableMinimizing="true" OnClientButtonClicked="CreateTable() return false;">
<telerik:RibbonBarTab Text="Home">
    <telerik:RibbonBarGroup Text="Table Generator">
        <Items>
                <telerik:RibbonBarControlGroup Orientation="Horizontal">
                    <Items>
                        <telerik:RibbonBarComboBox ID="txtRow" Width="60" runat="server">
                            <Items>
                                <telerik:RibbonBarListItem Text="0" Selected="true" />
                                <telerik:RibbonBarListItem Text="2" />
                                <telerik:RibbonBarListItem Text="4" />
                                <telerik:RibbonBarListItem Text="6" />
                                <telerik:RibbonBarListItem Text="8" />
                                <telerik:RibbonBarListItem Text="10" />
                                <telerik:RibbonBarListItem Text="12" />
                                <telerik:RibbonBarListItem Text="14" />
                                <telerik:RibbonBarListItem Text="16" />
                                <telerik:RibbonBarListItem Text="18" />
                                <telerik:RibbonBarListItem Text="20" />
                            </Items>
                        </telerik:RibbonBarComboBox>
 
                        <telerik:RibbonBarComboBox ID="txtCol" Width="60" runat="server">
                            <Items>
                                <telerik:RibbonBarListItem Text="0" Selected="true" />
                                <telerik:RibbonBarListItem Text="2" />
                                <telerik:RibbonBarListItem Text="4" />
                                <telerik:RibbonBarListItem Text="6" />
                                <telerik:RibbonBarListItem Text="8" />
                                <telerik:RibbonBarListItem Text="10" />
                                <telerik:RibbonBarListItem Text="12" />
                                <telerik:RibbonBarListItem Text="14" />
                                <telerik:RibbonBarListItem Text="16" />
                                <telerik:RibbonBarListItem Text="18" />
                                <telerik:RibbonBarListItem Text="20" />
                            </Items>
                        </telerik:RibbonBarComboBox>
                         <telerik:RibbonBarButton ID="btnGenerate" runat="server" Text="Create" />
                    </Items>
                </telerik:RibbonBarControlGroup>
        </Items>
    </telerik:RibbonBarGroup>

Script:

   function createTable() {
        var rowCtr;
        var cellCtr;
        var rowCnt;
        var cellCnt;
 
        var myTableDiv = document.getElementById("myDynamicTable");
 
        var table = document.createElement('TABLE');
        table.border = '1';
        table.id = "myTable";
 
        var tableBody = document.createElement('TBODY');
        table.appendChild(tableBody);
 
        rowCnt = document.getElementById('txtrows').value;
        cellCnt = document.getElementById('txtcols').value;
 
        for (rowCtr = 0; rowCtr < rowCnt; rowCtr++) {
            var tr = document.createElement('TR');
            tableBody.appendChild(tr);
 
            for (cellCtr = 0; cellCtr < cellCnt; cellCtr++) {
                var td = document.createElement('TD');
                td.width = '120';
                td.appendChild(document.createTextNode("Row:" + rowCtr + " Column:" + cellCtr));
                tr.appendChild(td);
            }
        }
        myTableDiv.appendChild(table);
}

OnClick of button(create) dynamic table should generate. but not happening can some one suggest what i had done wrong.

 

Peter Milchev
Telerik team
 answered on 11 Oct 2018
3 answers
101 views

I am using RadEditor as part of sitecore 8.2  I have used the following Editor.DisableFilter(EditorFilters.ConvertToXhtml);  this works great if i type into the editor but if i use a code snippet the html is changed below is the example html i am using

This works fine if pasted into the html tab

<a href="#">
<h3>Title of Section</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. </p>
</a>     
Marin Bratanov
Telerik team
 answered on 11 Oct 2018
1 answer
98 views

I am using this code in my handler.ashx file

public void ProcessRequest(HttpContext context)
{
Context = context;
string filePath = context.Request.QueryString["path"];
filePath = context.Server.MapPath(filePath);
if (filePath == null)
{
return;
}
System.IO.StreamReader streamReader = new System.IO.StreamReader(filePath);
System.IO.BinaryReader br = new System.IO.BinaryReader(streamReader.BaseStream);
byte[] bytes = new byte[streamReader.BaseStream.Length];
br.Read(bytes, 0, (int)streamReader.BaseStream.Length);
if (bytes == null)
{
return;
}
streamReader.Close();
br.Close();
string extension = System.IO.Path.GetExtension(filePath);
string fileName = System.IO.Path.GetFileName(filePath);
if (extension == ".jpg")
{ // Handle *.jpg and
  WriteFile(bytes, fileName, "image/jpeg", context.Response);
}
else if (extension == ".gif")
{// Handle *.gif
WriteFile(bytes, fileName, "image/gif gif", context.Response);
}
else if (extension == ".pdf")
{// Handle *.pdf
WriteFile(bytes, fileName, "application/pdf pdf", context.Response);
}
}
/// <summary>
/// Sends a byte array to the client
/// </summary>
/// <param name="content">binary file content</param>
/// <param name="fileName">the filename to be sent to the client</param>
/// <param name="contentType">the file content type</param>
private void WriteFile(byte[] content, string fileName, string contentType, HttpResponse response)
{
response.Buffer = true;
response.Clear();
response.ContentType = contentType;
response.AddHeader("content-disposition", "attachment; filename=" + fileName);
response.BinaryWrite(content);
response.Flush();
response.End();
}
public bool IsReusable
{
get
{
return false;
}
}

It doesn't work for JPEG files. It just opens a blank page.

What am I doing wrong?

Vessy
Telerik team
 answered on 11 Oct 2018
1 answer
748 views

Dear team,

I have a radcombobox which fetches around 10000 items, below is the markup 

 

                              <telerik:RadComboBox ID="ddlProducts" runat="server"
                                AppendDataBoundItems="true" TabIndex="1"
                                Filter="Contains" Skin="MetroTouch" RenderMode="Auto" 
                                EnableLoadOnDemand="true" ShowMoreResultsBox="true" Width="100%" Height="400px" OnClientBlur="Product_OnClientBlur"
                                EnableVirtualScrolling="true" OnClientItemsRequesting="GetActiveProducts" OnClientDropDownClosed="onDropDownClosed">
                                <WebServiceSettings Method="GetActiveProducts" Path="~/Inventory/WebServices/InventoryWebService.asmx" />
                                
                            </telerik:RadComboBox>

Every this is working perfectly in desktop browser , the issue is with mobile device .

When we type in the keywords and the dropdownlist is populated with records and starts scrolling then in mobile device the page starts scrolling and when the page scroll reach the end then only the dropdownlist og combobox starts scrolling.

How to avoid this , Please advice

Please find the attached screenshot for this behaviour.

Thanks & Regards

Sushanth.B

 

 

Marin Bratanov
Telerik team
 answered on 11 Oct 2018
4 answers
317 views
We have a RadComboBox with CheckBoxes set true. The drop down stays open after checking a checkbox so you can check more, which is fine. The problem is that when you click in a textbox while the dropdown is open an entry cursor appears in the textbox briefly as it gets focus but clears as the textbox loses focus when the combobox dropdown closes. It is necessary to click the textbox a second time before typing into it. Alternatively the combobox arrow must first be clicked to close the dropdown before clicking the textbox to transfer the focus.

Is there some way to prevent the combobox from retaining the focus when another control is clicked?
Attila Antal
Telerik team
 answered on 10 Oct 2018
13 answers
498 views
Hi,

May i know possible to do set focus inside in-mode editng textbox in radgrid?

How to do that?

Please advice.

Thanks.
Soo
Attila Antal
Telerik team
 answered on 10 Oct 2018
1 answer
275 views
I am building a radgrid programmatically. Can anyone tell  me how to find out if a particular DataKeyName exists in the grid - something like e.Item.OwnerTableView.DataKeyNames.Contains("OBJECTID"). Since this is a generic grid, I might not know if a datakey exists. When I try to use GetDataKeyValue I get a null reference exception because a datakey might not exist.
Attila Antal
Telerik team
 answered on 10 Oct 2018
1 answer
423 views

I have a radgrid hierarchy structure.  When the user navigates to the third level and clicks on the parent tickmark on the grid, the RadGrid1_ItemCommand is fired and I can retrieve the parent "ProgramID". 

But I need to pickup the parentID when the user clicks on the command-template button located just on top of the detail rows.  I would like to get the value within a client-side function or server-side if that is easier??? (but cannot get that to work well).  See attachment for a jpg of grid...

 

Thank you for you help with this request!

 

Client-Side code:

function openConfirmationWindowNEW(sender, args) {

    var programID= parentItem.OwnerTableView.Items[sender.Item.ItemIndex].GetDataKeyValue("ProgramID");          

    radopen("Storyboard.aspx?carID=programID, "RadWindow2");

}

 

Server-Side Code:

console.write((string) sender.Item.OwnerTableView.Items[e.Item.ItemIndex].GetDataKeyValue("ProgramID").ToString());

 

The code works below but it needs it to work from within a client-side function....

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
        {

            if (e.Item.OwnerTableView.DataSourceID == "SqlDataSource3")
            {
                GridDataItem parentItem = (GridDataItem)(e.Item.OwnerTableView.ParentItem);
                if (parentItem != null)
                {
                    //..tier 2 parent
                    Console.Write(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["StrategicInitID"]);

                    //..tier 3 parent
                    HiddenProgramIDSelected.Value = (string)e.Item.OwnerTableView.Items[e.Item.ItemIndex].GetDataKeyValue("ProgramID").ToString();

                }
            }
    }

    

Attila Antal
Telerik team
 answered on 10 Oct 2018
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?