Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
138 views

Hello,

I have a radgrid with a form template editform to do the updates. In this editform there is a radtextbox. To change the value of this radtextbox, I use a Radwindow. When the radwindow is closed, the selected value from the radwindow is sent to the radtextbox on the parent page. So the radtextbox in the form template editform has now the new value.

I use javascript:

function GetGridServerElement(serverID, tagName)
{
    if (!tagName)
        tagName = "*";
          
    var grid = document.getElementById("<%=RadGrid1.ClientID %>");
    var elements = grid.getElementsByTagName(tagName);
    for (var i = 0; i < elements.length; i++)
    {
        var element = elements[i];
        if (element.id.indexOf(serverID) >= 0)
            return element;
    }
  }
 
function clientShow(sender, EventArgs)
       {
    var radtextbox = GetGridServerElement("radtextbox", "input");
               sender.argument = radtextbox.value;
       }
 
   function clientClose(sender,args)
       {        
         if (args.get_argument()!= null)
         {
             var radtextbox = GetGridServerElement("radtextbox", "input"); 
 radtextbox.value = args.get_argument();  
         }             
       }


But when I click the update button from my form template editform, the value isn’t saved to the database. The old value of the radtextbox in my database isn’t replaced by the new one.
Anyone a solution?
Thank you!

David De Backer
Top achievements
Rank 1
 answered on 28 Feb 2011
2 answers
149 views
I have two radcomboboxes. When radcombobox VendorType SelectedIndex fires, radcombobox Vendor is then populated in code by the value chosen in VendorType . Radcombobox Vendor loads fine in code until I add the properties for MarkFirstMatch, EnableLoadOnDemand, and EnableTextSelection to radcombobox Vendor .  If I add these properties to the aspx page, then the radcombobox Vendor does not get loaded with the correct values on the selectedindexchange of radcombobox VendorType. If I do it in code after the radcombobox Vendor has done the binding or during the binding, radcombobox Vendor still does not get loaded with the correct values.

ASP.NET
<tr>
   <td>
       <asp:Label ID="Label25" runat="server" Text="Vendor Type: "></asp:Label>
   </td>
   <td>
       <telerik:RadComboBox ID="ddlVendorTypes" runat="server" SelectedValue='<%# Bind("RoleTypeCode") %>'
         DataSourceID="SqlDataSourceVendorTypes" DataTextField="Name" DataValueField="RoleTypeCode"
         AutoPostBack="true"  TabIndex="6" MarkFirstMatch="true" EnableLoadOnDemand="true"
         EnableTextSelection="true" onselectedindexchanged="ddlVendorTypes_SelectedIndexChanged">
      </telerik:RadComboBox>
   </td>
</tr>
<tr>
   <td>
      <asp:Label ID="Label6" runat="server" Text="Vendor: "></asp:Label>
   </td>
   <td>
      <telerik:RadComboBox ID="ddlVendors" runat="server" TabIndex="8">
     </telerik:RadComboBox>
   </td>
 </tr>

Binding Code
protected void ddlVendorTypes_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
{
    GridEditableItem editedItem = (o as RadComboBox).NamingContainer as GridEditableItem;
    RadComboBox ddlVendors = editedItem.FindControl("ddlVendors") as RadComboBox;
    RadComboBox ddlVendorTypes = editedItem.FindControl("ddlVendorTypes") as RadComboBox;
    VendorBinding(ddlVendors, ddlVendorTypes.SelectedValue);
}
private void VendorBinding(RadComboBox ddlVendors, string VendorType)
{
    if (SqlDataSourceVendors.SelectParameters.Count > 0)
        SqlDataSourceVendors.SelectParameters.RemoveAt(0);
    SqlDataSourceVendors.SelectParameters.Add("RoleTypeCode", VendorType);
    ddlVendors.DataSource = SqlDataSourceVendors;
    ddlVendors.DataTextField = "Name";
    ddlVendors.DataValueField = "PartyRoleID";
    ddlVendors.DataBind();
}


Roger
Top achievements
Rank 1
 answered on 28 Feb 2011
1 answer
102 views
I am having a problem with anchors and bulleted links specifically in Internet Explorer. I can reproduce using the Telerik demo at:

http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx

Steps (using IE8):

- Create 4 bullet points and give each some text
- Select the text using the mouse in the second bullet point and insert a link and point it to http://www.google.com

The bullet as well at the text becomes part of the link and view source shows the following (note the anchor is outside the li rather than within it):

<ul>
    <li>link 1</li>
    <a href="http://www.google.com">
    <li>link 2</li>
    </a>
    <li>link 3</li>
    <li>link 4</li>
</ul>

The problem is IE selects a space after link 2 when you let go of the mouse when inserting the anchor even though there is no space to select. If you select 'link 3' without the space (put the cursor before the l and shift +right arrow to only select the text) and insert the same anchor again, you get the following correct code:

 <li><a href="http://www.google.com">link 3</a></li>

I guess this is an IE issue as it does not happen in chrome or firefox. That said, is this a known issue and is there any workaround as shift selecting is not ideal?

Many thanks
Rumen
Telerik team
 answered on 28 Feb 2011
13 answers
828 views
Hi,

Iam using a Rad Splitter with left pane,Splittrebar and Content pane.The Content pane takes sometime to load the pages.So we would like to put a ajax loading panel to show the page is just loading.

I checked in the following link
http://www.telerik.com/help/aspnet/ajax/ajxshowloadingpaneloninitialpageload.html

But the problem is the ajax laoding image doesn't show up until the page is loaded.Once after the page is laoded it shows the image and the page loads again

I have two requirement
1) The ajax laoding panel should be available for initial page load
2) The ajax loading panel should be visible for content pane when the user clicks the links on the left pane.

Thanks and Regards
V.Balamurali
Dobromir
Telerik team
 answered on 28 Feb 2011
7 answers
230 views
Following the instructions on the website, I am generating the XML below, but the control refuses to load it
The control says the error is at line 215, which corresponds to the bold section below.

Essentially I am trying to create 3 parent items, 1 of which has 1 item with a sub-menu item within it.

I am loading the XML into an XMLDocument to validate the structure, so I don't understand what the problem is.


<Menu>
<Group Text='Home' URL='#'></Group>
<Group Text='Corporate' URL='#'>
    <Item Text='child page 1' URL='PageView.aspx?ContentId=2'>
  <Group>
       <Item Text='page level 2' URL='PageView.aspx?ContentId=3'/>
  </Group>
</Item>
</Group>
<Group Text='Tools' URL='#'></Group>
</Menu>

Thanks,

Morgan
Morgan
Top achievements
Rank 1
 answered on 28 Feb 2011
1 answer
81 views
I have a hierarchical(or however its spelled) grid, a master(account), first detail(contact) second detail(phone numbers).  On the detail grids i have added command items to allow the user to add new contacts to a account or phone numbers to a contact.  I also have an edit button in the grid so they can change current values. 

I'm using the EditForm Template in a PopUp edit mode, when i click the Add new button in the Command Item i get the InitInsert name in ItemCommand and in item databound the grid is in edit mode, since it uses the same form for edit and insert i show and hide different fields on data bound, if its editing or inserting, i also change the command name of the button on the form so i know what to do when the user clicks it (insertContact, UpdateContact, etc..) On Insert everything works, the proper fields are displayed the proper command name gets passed back to the ItemCommand event, however on Edit the display works (only the editable fields are shown) and in ItemDataBound the grid is in edit mode, the popup shows.  When i click the edit button the popup shows and when i click the update button ItemCommand still fires and i get the UpdateContact command name, but the grid is no longer in edit mode.  I cant find a way to access the controls that were in the edit form popup since the event args in ItemCommand is a GridDataItem and not a GridEditFormItem like it is on an Insert.

Basically i need to know if i can share the same form for Edits and Inserts(since i dont seem to have a choice), and how can i get to the controls on the edit form from the ItemCommand event if e.Item isnt a GridEditFormItem.  I've checked a lot of the help documentation, but cant seem to find a way to accomplish what i need to do.


EDIT:
The problem appears to be caused by me changing the CommandName of the button for an Edit.  If you leave(or set) the CommandName as "Update" everything works correctly in the ItemCommand Event.  I just put a flag in the CommandArgument property to figure out which update code i should run.

Wish there was a better way like EditForm and InsertForm templates to keep everything seperate, and not have to have code in ItemCommand and ItemDataBound to hide and show bits but oh well. 
/EDIT

Mira
Telerik team
 answered on 28 Feb 2011
1 answer
118 views
Sometimes after multiple postbacks on the page, the Rad Editor renders strangely.
Editor's height-width spans all over the page and the width becomes like 5000 pixels.
The editor controls are also rendered like bullet points without any image.

The editor control is inside a HTML table having a fixed width of 800px
I will not be able to provide the page code as the page is very complex.

Kindly see the attached image for more reference.

Please help me in sorting out the issue.
Rumen
Telerik team
 answered on 28 Feb 2011
16 answers
746 views
Hello,

I'm using the some RadComboBoxes on my WebUserControl that is used to Edit RadGrid Items.
Some of this Comboboxes are related. I have followed your Example: "Related ComboBoxes" of your Onlinedemos. All seems to be working, i can select values in the first ComboxBox and after this the related ComboBox gets refreshed and I'm able to select Items in the second one. But when i hit the Button for the Update the SelectedValue Property of the Second ComboBox is Empty but the Text Property shows the right selected Itemtext.

What I'm doing wrong?

EDIT:
Something strange is going on... trying to explain.

When WebUserControl Loads, ComboBox 1 Items looks like:

1, Item1 (selected)
2, Item2
3, Item3

where the first column presents the Value and the Second column the Text of the ComboBox
ComboBox2 Items look like this:

1, Item1a
2, Item2a (selected)

where the first column presents the Value and the Second column the Text of the ComboBox.

So ComboBox1.SelecedValue=1 and ComboBox2.SelectedValue=2

When i change the Selected Item in ComboBox1 to Item3 (Value = 3) then the ComboBox2 gets new Items like this:

1, Item3a
2, Item3b
3, Item3c

where the first column presents the Value and the Second column the Text of the ComboBox. No Item is then initial selected.
When i now change the SelectedItem of ComboBox2 to Item3b (Value 2) the Update Function of the RadGrid does not get a valid SelectedValue. When i select the Item "Item3c" it also does not get a valid value. Only when i select the First Entry "Item3a" i get a valid SelecedValue of "1"

For me it looks like that the Selected Value gets only avaliable on Postback when the Initial Itemlist contains the same Value as the reloaded Itemlist and the Selected Item in the reloaded list does not have the same Value as the Initial Selected Item.

Strange strange strange....

Kalina
Telerik team
 answered on 28 Feb 2011
2 answers
180 views
While in SharePoint Designer and editing the Master Page, I tried to insert a RadMenu and I get the following:

Error Creating Control - RadMenu1
Designer creation failed for the control Parameter name: this...

I am new to this and possibly missed a step somewhere.  Can you help?
Joe Weber
Top achievements
Rank 2
 answered on 28 Feb 2011
1 answer
105 views
I have a master page (nested although i dont think this is relavent) and within tha page i have 2 usercontrols (a header file and quick login panel).

In the header usercontrol i have a hyperlink to register which i want to change when the user logs in to myaccount.

I have wrapped the hyperlink in a radajaxpanel as follows

<li><Telerik:RadAjaxPanel ID="rapHypRegister" runat="server" ><asp:HyperLink ID="hypUtilNavRegister" runat="server" Text="Register" ToolTip="Register" NavigateUrl="~/register.aspx" /></Telerik:RadAjaxPanel></li>


and also ALL my code for the login usercontrol (rapLogin).  I am using the following radajax manager

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
               <AjaxSettings>
                   <telerik:AjaxSetting AjaxControlID="rapLogin">
                       <UpdatedControls>
                           <telerik:AjaxUpdatedControl ControlID="rapLogin" LoadingPanelID="RadAjaxLoadingPanel1" />
                           <telerik:AjaxUpdatedControl ControlID="rapHypRegister"  />
                       </UpdatedControls>
                   </telerik:AjaxSetting>
          </AjaxSettings>
      </telerik:RadAjaxManager>


On the login user control, once the login code is finished I am referncing the header control with a view to changing the text and navigate link as follows.

'Now we need to change the register text in the header usercontrol
               'Lets find the usercontrol
               Dim MyControl As Control = Me.Page.Master.Master.FindControl("header1")
               'Now we need the update panel from the header usercontrol
               'Dim radRegUpdatePanel As RadAjaxPanel = MyControl.FindControl("rapRegister")
               'Now we can access the hyperlink
               Dim hypMyregLink As HyperLink = MyControl.FindControl("hypUtilNavRegister")
               hypMyregLink.Text = "My Account"
               hypMyregLink.NavigateUrl = "~/myaccount.aspx"


This is not happening...if if remove all the radajaxpanels then the hyperlink gets updated as it should. Am i missing something?

I should point out when the radajaxpanel is in place they both get the animation and "look" like its working but by text does not change.

Many thanks,

Stephen
Tsvetina
Telerik team
 answered on 28 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?