Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
142 views
Hi, I am putting together a website using some pages with telerik controls on them and then also the Blogengine.net open source system.  When I try and use the RadBinaryImage control on a page which inherits from a masterpage it doesn't show any of the images in a configured folder (like the demo).  Instead it shows the broken image icon.

What could I be doing wrong?  I have a zip file with a small project but can't attach it to this thread -

any ideas?

Many thanks

Alan
Shinu
Top achievements
Rank 2
 answered on 27 Jan 2014
2 answers
136 views
I want Root node , child node only  selected value's individual [ with out array format & check box] of Rad drop down tree  server said code
Kate
Telerik team
 answered on 27 Jan 2014
1 answer
59 views

When using a template for group headers, how does one catch the events (server side) triggered by a control therein?


basically I want to be able to click a groupheader and call a procedure to open radwindow.  This is easy to do on grid rows, but haven't found a way to do in group headers other than to add a control to it.    There seems to be two ways, programmatically add all controls (no template) or define a control(s) in a groupheader template.  However I can't seem to trap the events when using a template.



Is there a method I am over looking or Is there a way to add a eventhandler after the control is created?  Thanks.

Eyup
Telerik team
 answered on 27 Jan 2014
4 answers
246 views
Hi,
I am working for  Script injection in my project. suppose user enter some script in comment box which is free text (<script  type="text/javascript">alert('Hi')</script>). 
I used Server.HTMLEncode/HTMLDecode method to save in DB and show in text box respectively. But when I show in RadGrid with item template and Label control. It show alert instead of as text. Its working fine with simple textbox control but perhaps, issue with controls inside grid. One more thing I don't want to use ValidateRequest = false; any how as it may restrict to save such text.

Sample code I am using for Grid. I also tried in code behind with itemdatabound event of grid to bind Label.
<ItemTemplate>
        <asp:Label ID="lblComments" runat="server"   Text='<%#Server.HtmlDecode(Eval("Comments").ToString())%>' />
</ItemTemplate>

Any suggestion???? Is there any property/Method of Grid to resolve this issue.
Thanks in advance.
Sanjeev
Top achievements
Rank 1
 answered on 27 Jan 2014
5 answers
180 views
 When I enable the option to display "ALL" records int he grid, it is working. But when I add one more item with the ALL option selected, it throws an error.
Following code is my workaround. With this code, with ALL selected, when I add a new item, it goes to the second page, though all items shouls fit in the first page itself ( I have less than 50 items).

protected

 

 

void rgProjects_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)

 

{


 

 

if (e.Item is GridPagerItem)

 

{

 

 

var dropDown = (RadComboBox)e.Item.FindControl("PageSizeComboBox");

 

 

 

var totalCount = ((GridPagerItem)e.Item).Paging.DataSourceCount;

 

 

 

bool ALLSelected = (dropDown.SelectedItem.Text == "ALL") ? true : false;

 

 

 

var sizes = new Dictionary<string, string>()

 

{

{

 

"50", "50"},

 

{

 

"100", "100"},

 

{

 

"200", "200"}

 

};

sizes.Add(

 

"All", totalCount.ToString());

 

dropDown.Items.Clear();

 

 

foreach (var size in sizes)

 

{

 

 

var cboItem = new RadComboBoxItem()

 

{

Text = size.Key,

Value = size.Value

};

cboItem.Attributes.Add(

 

"ownerTableViewId", e.Item.OwnerTableView.ClientID);

 

dropDown.Items.Add(cboItem);

}

 

 

try

 

{

 

 

if (ALLSelected)

 

dropDown.FindItemByValue(totalCount.ToString()).Selected =

 

true;

 

 

 

else

 

{

 

 

RadComboBoxItem item = dropDown.FindItemByValue(rgProjects.PageSize.ToString());

 

 

 

if (item != null) item.Selected = true;

 

}

}

 

 

catch (Exception ex)

 

{

ShowValidationMessage(ex.Message);

}

}
}

Viktor Tachev
Telerik team
 answered on 27 Jan 2014
1 answer
390 views
I have a web service that I want to return 2 values   and ID and a text value hrough and autocompletebox.  I have it working to return the service but now I need to get at the ID value that was returned, not the text value.  I would like to be able to do an Autopostback on the autocompletebox and hit a database with the ID to return more data to the page.  Is this possible iwht the autocompletebox as I have not been able to find code that shows this.  It would be similar to the asp Autocomplete extender that can return 2 values that you can then use.  Can I do this with a telerik AutocompleteBox.


<telerik:radautocompletebox ID="rdSearch" runat="server" EmptyMessage="Type Last Name First Name" EnableAutoComplete="true" MinFilterLength="2" MaxResultCount="20" Width="260px"
                                   DropDownHeight="100px" DropDownWidth="250px" DropDownPosition="static" AutoPostBack="true" OnClientEntryAdded="requesting">
                                    <TextSettings SelectionMode="Single" />
                                    <WebServiceSettings Path="../AutoComplete.asmx" Method="GetNames" />
                                </telerik:radautocompletebox>
 
 
  function requesting(sender, eventArgs) {
            var context = eventArgs.get_context();
            //Data passed to the service.
           // context["ClientData"] = "ClientData_Passed_To_The_Service";
        }
 
 
 [WebMethod]
    public AutoCompleteBoxData GetNames(RadAutoCompleteContext context)
    {
        string sql = "select intPersonnelId, strFullname FullName FROM tblMNNatPersonnel WHERE strFullname like '" + context.Text + "%'";
        //SqlDataAdapter adapter = new SqlDataAdapter(sql, ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString);
         
        DataTable myDataTable = new DataTable();
        myDataTable = c.GetReader(sql);
 
        List<AutoCompleteBoxItemData> result = new List<AutoCompleteBoxItemData>();
        AutoCompleteBoxData dropDownData = new AutoCompleteBoxData();
 
        result = new List<AutoCompleteBoxItemData>();
 
        for (int i = 0; i < myDataTable.Rows.Count; i++)
        {
            AutoCompleteBoxItemData itemData = new AutoCompleteBoxItemData();
            itemData.Text = myDataTable.Rows[i]["FullName"].ToString();
            itemData.Value = myDataTable.Rows[i]["intPersonnelId"].ToString();
 
            result.Add(itemData);
        }
 
        dropDownData.Items = result.ToArray();
        return dropDownData;
    }
 
When it returns to the autocomplete box I need to do take the intPersonnelId and hit a database and return more information.


Kate
Telerik team
 answered on 27 Jan 2014
8 answers
1.2K+ views
How do I disable the enter key rebind on RadGrid? I can't find a setting to either make the entire table read only, or just disable the enter key.

AllowKeyboardNavigation = "false" and <KeyboardNavigationSettings EnableKeyboardShortcuts="false" AllowSubmitOnEnter="false" /> do not disable the enter key. There is no need for this functionality to be permanently on. Rebinding 10,000 rows because someone accidentally hit enter is not a valid option.

Programming this via javascript seems hokey and cheap as a workaround, but if that's my only option... 

Please assist.

Regards,
~Owen



Konstantin Dikov
Telerik team
 answered on 27 Jan 2014
3 answers
139 views
Hello,
i've got an issue ralated to RadComboBox. When I use it without checkboxes it seems that all is ok: [look at comboissue1.png]
Unfortunately after switching to CheckBoxes dropdown choose to render in down direction and sets height that is to big to fit window.
[look at comboissue2.png]. 
I set a breakpoint on OnClientDropDownOpened and at that moment DropDown's height and directon are ok [look at comboissue3.png]. I don't know what spoils it after. 

.


Nencho
Telerik team
 answered on 27 Jan 2014
2 answers
111 views
Hi,
Is this normal that when I have two ListBoxes and one of them is empty the second one is populated with items, I can't drop any items into the empty one?
I'm seeing such behavior and don't know why this is happening.
Shinu
Top achievements
Rank 2
 answered on 27 Jan 2014
6 answers
220 views
Hi,
I have been trying to extend the Telerik GridBoundColumn. Everything seems to be OK when it is used in the statdarnd RadGrid without Filtering.
When I turn on the AllowFilteringByColumn property of the RadGrid, I get the following error message:
 Multiple controls with the same ID 'FilterTextBox_Date' were found. FindControl requires that controls have unique IDs. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
 
Exception Details: System.Web.HttpException: Multiple controls with the same ID 'FilterTextBox_Date' were found. FindControl requires that controls have unique IDs. 
 
Source Error: 
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace: 
 
[HttpException (0x80004005): Multiple controls with the same ID 'FilterTextBox_Date' were found. FindControl requires that controls have unique IDs.] 
   System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +273 
   System.Web.UI.Control.FillNamedControlsTable(Control namingContainer, ControlCollection controls) +320 
   System.Web.UI.Control.EnsureNamedControlsTable() +61 
   System.Web.UI.Control.FindControl(String id, Int32 pathOffset) +222 
   System.Web.UI.Control.FindControl(String id) +12 
   Telerik.Web.UI.GridColumn.PrepareCell(TableCell cell, GridItem item) +1238 
   Telerik.Web.UI.GridItemDecorator.DecorateItem(GridTableView owner, GridColumn[] columnArray) +364 
   Telerik.Web.UI.GridFilterItemDecorator.DecorateItem(GridTableView owner, GridColumn[] columnArray) +112 
   Telerik.Web.UI.GridItem.PrepareItemStyle() +259 
   Telerik.Web.UI.GridMultiRowItem.PrepareItemStyle() +109 
   Telerik.Web.UI.RadGrid.PrepareRows(GridTableView view) +132 
   Telerik.Web.UI.RadGrid.Render(HtmlTextWriter writer) +92 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163 
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32 
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40 
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29 
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266 
 


And these are my code:

New GridBoundColumn
  public class MyGridBoundColumn : GridBoundColumn 
    { 
 
    } 




Aspx:
    <telerik:DDSGrid ID="uxGrid" runat="server" GridLines="None" Width="100%" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AllowFilteringByColumn="true" 
            OnNeedDataSource="uxGrid_NeedDataSource" EnableEmbeddedSkins="false"
            <MasterTableView > 
                <Columns> 
                    <me:MyGridBoundColumn HeaderStyle-HorizontalAlign="Center" UniqueName="Row" HeaderText="Row" DataField="Row"/> 
                </Columns> 
                 
            </MasterTableView> 
        </telerik:DDSGrid> 

Codebehide:
protected void uxGrid_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
 
    DataTable tb = new DataTable("tb"); 
    DataColumn col; 
    DataRow row; 
 
    col = new DataColumn("Row"); 
    tb.Columns.Add(col); 
 
 
    for (int i = 1; i <= 1; i++) 
    { 
        row = tb.NewRow(); 
        row["Row"] = "Row " + i; 
        tb.Rows.Add(row); 
    } 
    ((RadGrid)source).DataSource = tb; 

Is there anyone can help me to solve this problems? Thanks




$_$
Top achievements
Rank 1
 answered on 27 Jan 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?