Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
226 views
HI.
We have a number of buttons on the page that trigger the show of the Tooltip and the OnAjaxUpdate event server side.
This has worked perfect for a year now using this code.

    protected void OnModalUpdate(object sender, ToolTipUpdateEventArgs e) {
      ControlInfo controlInfo = getControlInfo(e.Value);
      loadActivityControl(true, e.UpdatePanel, controlInfo);
    }

But now we have gotten a new request from our users that they want to be able to go to another control from within one of the controls that reside in the UpdatePanel provided by the tooltip manager. I can not add more button id's to the

TargetControls collection so i need to change the content of the updatepanel in another way. I tried this in my event that will trigger new content to be loaded into the updatepanel.. the member modalManager is the ToolTipManager (We use the tooltip as a popup (Modal) window)

    private void LoadModalControl(object sender, LoadModalControlEventArgs e)
    {
      modalManager.UpdatePanel.ContentTemplateContainer.Controls.Clear();
      loadActivityControl(true, modalManager.UpdatePanel, e.ControlInfo);
      modalManager.UpdatePanel.Update();
    }

This works as far as the correct control loads and everything looks good, but if i do a postback now i get this error
"Microsoft JScript runtime error: Sys.InvalidOperationException: Could not find UpdatePanel with ID 'ctl00_MainContent_ctl03_updatePanel'. If it is being updated dynamically then it must be inside another UpdatePanel"

Best regards, Anders
Svetlina Anati
Telerik team
 answered on 03 Nov 2009
2 answers
316 views
I have a RadTextBox control on a page where the user must enter a new value unique to the database contents (such as with a new user "Screen Name").  I have put a a button on the page next to the RadTextBox that opens a RadWindow so the user can "try" different values until they get a value that is unique (view attached graphic file RadWindow1).  When the user finds a unique value, they can click on a "submit" button to post the value to the RadTextBox on the parent page.

This is all working just fine -- except the displayed value in the RadTextBox on the parent window never shows the updated/changed value.  The RadTextBox does actually contain the new value, it just is never displayed.

For example...the user keys "Bill" into the RadTextBox, then clicks on the "Check" button to display the RadWindow to test the value against the database. Let's suppose "Bill" has to be changed to "Bill123" to get a unique value.  The user would then click on the "Submit" button in the RadWindow to close the window and store the "Bill123" value in the RadTextBox known as "Screen Name".

The javascript being executed when the RadWindow is closed is shown in the graphic file "radwindow2" below.

I have found another forum entry that exactly describes this problem at http://forums.asp.net/p/1440589/3261260.aspx .  Apparently, this is somewhat of a known problem with the RadWndow and the RadTextBox when used in this scenario.

Is there any way to get the RadTextBox to display the newly updated value?  If I click the mouse in the Screen Name field after it has been updated, the new value will "magically" display (just as described in the forum link specified above).

Thanks in advance if anyone can tell me how to correct this behavior!

Lynn

P.S. - I apologize for the somewhat confusing variable/field names used in the javascript code.  I have been using your demo of the RadWindow control -- "Returning Values from a Dialog" as a starting point and then modifying in "baby steps" until getting what I need.
So the variable names are a combination of those from the demo and from my web page.

Lynn
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
151 views
Hi

I saw this sample that shows how to make the RadTextBox accept only valid e-mail addresses
http://www.telerik.com/help/aspnet/input/input_radtextboxemailmask.html


Do you have a similar sample to use the RadTextBox to accept only valid web address?

Thanks
Dimo
Telerik team
 answered on 03 Nov 2009
6 answers
326 views
I am trying to use the CommandItem to add a new record to my grid. But when I process the "RadGrid2_ItemCommand" event in my code-behind, the textbox I entered a value into does not contain the text.

My procees is this: I click the "add new record" link and the insert template displays where I can type in my field data. I click insert and it goes to the Radgrid2_itemcommand event. But the Text property of the textbox is empty.

Thoughts?

Here is the radgrid (simplified)...

      <telerik:RadGrid ID="RadGrid2" runat="server" PageSize="20" AllowPaging="True" AllowSorting="True"
         GridLines="None" AllowFilteringByColumn="True" AutoGenerateColumns="false" OnItemDataBound="RadGrid2_ItemDataBound"
         OnItemCommand="RadGrid2_ItemCommand">
         <ClientSettings>
            <Selecting AllowRowSelect="True" />
         </ClientSettings>
         <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top">
            <Columns>
               <telerik:GridBoundColumn DataField="ProposalName" DataType="system.string" HeaderText="Proposal Id"
                  ReadOnly="True" SortExpression="ProposalName" UniqueName="ProposalName">
               </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings EditFormType="Template">
               <FormTemplate>
                  <table id="Table1" cellspacing="1" cellpadding="1" width="250" border="0">
                     <tr>
                        <td>
                           Proposal Id:
                        </td>
                        <td>
                           <asp:TextBox ID="TextBoxInsertedProposalName" Text='<%# Bind( "ProposalName" ) %>'
                              runat="server" />
                        </td>
                     </tr>
                     <tr>
                        <td align="right" colspan="2">
                           <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                              runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                           </asp:Button>&nbsp;
                           <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                           </asp:Button>
                        </td>
                     </tr>
                  </table>
               </FormTemplate>
            </EditFormSettings>
         </MasterTableView>
      </telerik:RadGrid>

Here is my code-behind...

    protected void RadGrid2_ItemCommand(object source, GridCommandEventArgs e)
    {

        if (e.CommandName == RadGrid.PerformInsertCommandName) // after the user clicks "insert"
        {
            GridEditableItem editedItem = e.Item.OwnerTableView.GetInsertItem();

            string insertedProposalName = (editedItem.FindControl("TextBoxInsertedProposalName") as TextBox).Text;
            // this should have the value ABCD but instead has the value string.empty

            Hashtable newValues = new Hashtable();
            foreach (DictionaryEntry entry in newValues)
            {
                string key = entry.Key.ToString();

                if (key == "ProposalName")
                {
                    string value = entry.Value.ToString();

                    Debug.Print(key + " = " + value);
                    break;
                }
            }
        }
    }

Johny
Top achievements
Rank 1
 answered on 03 Nov 2009
1 answer
129 views
Hi,

I'm using version 2009.2.1007.35 of the radcontrols at the moment. I have a RadScheduler component in my page.
Moving an appointment results in a piece of javascript running, which uses a call to a webmethod to see if the appointment can be moved. Because I don't want the appointment to "jump around on the screen", I don't cancel the event.
When the call to the webmethod returns, it might return a value indicating that the move was invalid or not allowed. In that case, I have to move the appointment back to its original time (begin and end), but also to its original resource.

To do this I have this piece of code:
var curResource = telerikAppointment.get_resources().getResourceByType("Employee"); 
curResource.set_key(oldEmployeeID); 
curResource.set_text(oldEmployeeName); 
telerikAppointment.set_start(oldStartTime); 
telerikAppointment.set_end(oldEndTime); 
radScheduler.updateAppointment(globalData.telerikAppointment, false); 

But now the problem:

When this code has run, the resource in the scheduler itself is also overwritten. I will try to explain this: Say I move an appointment from resource 1 to 2, but it is invalid, so I move it back to 1 using the code as above. Afterwards, everything I move to 2 will have e.get_targetSlot().get_resource().get_key() = 1 in a handler for the OnClientAppointmentMoveEnd event, while that should be 2. So it seems the set_key and set_text on the resource of the appointment has also overwritten the resource of the scheduler itself.

This might be intended (probable the resources of the appointment ARE the resources known in the Scheduler), so I'm not sure if this is a bug. But in any case, I'm looking for a way to move an appointment from one resource to another in clientside javascript, without messing things up

Any help would be greatly appreciated!
Datamex
Top achievements
Rank 2
 answered on 03 Nov 2009
1 answer
97 views
Hi All,

Have a Radgrid with a record in Check box.

AutomaticInsert="False"
AutomaticUpdate= "False"
AutomaticDelete = "False"

When Edit is clicked Works fine.

When Add New Recod is clicked Error appears

<telerik:GridTemplateColumn HeaderText="Is Earning?" UniqueName="Earning"   
                     DataField="Earning"  SortExpression="Earning">  
                       <ItemStyle HorizontalAlign="Center" Width="10%"  /><%--Width="70px"--%>  
                        <HeaderStyle HorizontalAlign="Center"  />  
                        <ItemTemplate>  
                        <asp:CheckBox ID="chkEarning" runat="server" Enabled="false"    
                        Checked='<%# Convert.ToBoolean(Eval("Earning")) %>'></asp:CheckBox>  
                        </ItemTemplate>  
                        <EditItemTemplate>  
                          <asp:CheckBox ID="chkEarningEdit" runat="server"                             
                          Checked='<%# Convert.ToBoolean(Eval("Earning")) %>'></asp:CheckBox>                           
                        </EditItemTemplate>  
                    </telerik:GridTemplateColumn> 

Object cannot be cast from DBNull to other types.

In the Check Box.

The Problem is while Add New Record, The Earning has the value NULL, How to rectify this.

-Anto
Daniel
Telerik team
 answered on 03 Nov 2009
1 answer
138 views
First, I realize I can use RadInputManager to eliminate the init function by using plain old asp.net controls.

Now that we have that cleared up, why in the world would you want to make me have to do that?!?! Seriously, I buy controls from a control vendor to make my life easier not to create more work. I need to be able to drop a control from a control vendor on a page, set it properties, and move on to my next task. 

You REALLY need to do something to make your controls faster on page load by either not having every control call an init function or making them smart and calling a single init function. And if it is the second option then that single init function had better be fast. I'm at the point where I'm going to have to make a go / no go decision on using the RAD Controls anymore because they are sooooooooooooo sllllllllllllooooooooooooooooowwwwwwwwwwwwwwwwwwwww!!!!!
Vlad
Telerik team
 answered on 03 Nov 2009
2 answers
167 views
I've been researching optimization tips and tricks and have been playing around with disabling viewstate on my grids. However, I've ran into an issue where the ItemCommand event doesn't fire when disabling viewstate. This is an issue for me because nearly all my grids are functional; i.e. they are not display only grids. I also use DataKeyNames quite extensively and am curious if this is affected by disabling viewstate.

So, I just wanted to verify that it is expected that ItemCommand will not fire when viewstate is disabled or if I'm doing something wrong.
Vlad
Telerik team
 answered on 03 Nov 2009
1 answer
107 views

Is it possible to set the width or position of the SlidingPane tabs?


Thanks.


Svetlina Anati
Telerik team
 answered on 03 Nov 2009
1 answer
173 views
I was wondering if there is a way to put only one column in edit mode.

I have tried setting the ReadOnly property to true except the column I want to be in Edit mode. I then use:

for (int i = 0; i < RadGrid_Main.PageSize; i++)
{
       RadGrid_Main.EditIndexes.Add(i);
}

This achieves the effect I am looking for, but then the grid shows the Edit skin for every row. I want to grid to look normal except show edit boxes for only 1 column. Is there any way around this?

Thanks,
Lucas
Princy
Top achievements
Rank 2
 answered on 03 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?