Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
241 views
Good day,

I have the following. I have a dropdownlist control in an Insert view mode. I need that my dropdownlist populates a pair of textbox controls from the database in the same view. I'm using the ddlEntityTypeFilter_SelectedIndexChanged event in order to do it. However I have got an error during the process since the Texbox control is returning a null value then I haven't been able to populate the texbox controls. Actually I need to populate Encargado2 and Email2 textbox controls.

Here is the aspx file:
<telerik:GridTemplateColumn  UniqueName="Nombre" DataField="Nombre" HeaderText="Nombre del Area"
             ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" >            
               <EditItemTemplate>   
                    <asp:DropDownList CssClass="dropdownlist" ID="ddlNombre" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlEntityTypeFilter_SelectedIndexChanged"></asp:DropDownList
                        <asp:Label ID="LabelNombre" runat="server" Text='<%#Eval("Nombre") %>'></asp:Label>                   
                </EditItemTemplate>
                    <ItemTemplate>
                    <asp:Label ID="LabelNombre" runat="server" Text='<%#Eval("Nombre") %>'></asp:Label>
                </ItemTemplate>
            </telerik:GridTemplateColumn
 
 <telerik:GridBoundColumn UniqueName="Encargado" DataField="Encargado" HeaderText="Encargado">
      </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Email" DataField="Email" HeaderText="Email">
      </telerik:GridBoundColumn>
       
      <telerik:GridTemplateColumn  UniqueName="Encargado2" DataField="Encargado2" HeaderText="Encargado2"
             ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" Visible="false" >  
          <%--   <ItemTemplate>
                    <asp:Label ID="LabelEncargado2" runat="server" Text='<%#Eval("Encargado2") %>'></asp:Label>
                </ItemTemplate>--%>
                  <EditItemTemplate>   
                    <asp:TextBox  ID="TextBoxEncargado2" runat="server"></asp:TextBox
                        <asp:Label ID="LabelEncargado2" runat="server" Text='<%#Eval("Encargado2") %>'></asp:Label>                   
                </EditItemTemplate>
            </telerik:GridTemplateColumn
       
         <telerik:GridTemplateColumn  UniqueName="Email2" DataField="Email2" HeaderText="Email2"
             ForceExtractValue="InEditMode" ConvertEmptyStringToNull="true" Visible="false" >  
                <%--    <ItemTemplate>
                    <asp:Label ID="LabelEmail2" runat="server" Text='<%#Eval("Email2") %>' ></asp:Label>
                </ItemTemplate>--%>
                 <EditItemTemplate>   
                    <asp:TextBox  ID="TextBoxEmail2" runat="server"></asp:TextBox
                        <asp:Label ID="LabelEmail2" runat="server" Text='<%#Eval("Email2") %>'></asp:Label>                   
                </EditItemTemplate>
            </telerik:GridTemplateColumn>
And the code behind:
protected void ddlEntityTypeFilter_SelectedIndexChanged(object sender, EventArgs e)
{    
    DropDownList dropdown = (DropDownList)sender;
    string value = dropdown.SelectedValue;
    SpecialTablesController sp = new SpecialTablesController();
    GridEditFormInsertItem edititem = (GridEditFormInsertItem)dropdown.NamingContainer;
    TextBox TextBoxID = (TextBox)edititem.FindControl("Encargado2"); -> TextboxID is null     
    Dependencia obj = sp.GetDependencyValues(dropdown.SelectedValue);
    TextBoxID.Text = obj.Encargado;-> I got the error here NullReferenceException
    TextBoxID.Text = obj.EMail;      
 
}
Any suggestion?

Thanks in advance
William
william
Top achievements
Rank 1
 answered on 15 Nov 2010
1 answer
105 views
Hi,

I am trying to display a confirmation box and based on the result I need to do further processing.
Currently, I am using a windows confirm and everything runs fine. I am not able to achieve the same functionality with a radconfirm. Can you assist?

On click of a button I am running this code:
Private Sub ConfirmUpdate(ByVal confirmText As String)
  
        Dim sb As StringBuilder = New StringBuilder()
        sb.Append("<script type='text/javascript'>")
        sb.Append("ConfirmUpdate('" + confirmText + "');")
        sb.Append("</script>")
  
        RadAjaxManager1.ResponseScripts.Add(sb.ToString())
  
    End Sub

In the js I do this:
function ConfirmUpdate(confirmText, action) {
            if (confirm(confirmText)) {
                document.getElementById('<%= btnUpdate.ClientID %>').click();
            }
        }

I get js errors when i try the same with radconfirm.
I need to change the style and the confirm button text so I want to use radconfirm. I read somewhere that if(confirm) kind of scenario is not possible with the blocking execution thread functionality of radconfirm.
I am using VB.NET

Please advice.
Cori
Top achievements
Rank 2
 answered on 15 Nov 2010
23 answers
194 views
I have strange problem with the dialogs. Sometimes they do not load completely and when I close the window, the editor stays in gray with freeze mode. What can be the problem?
Rumen
Telerik team
 answered on 15 Nov 2010
6 answers
136 views
IE and Mozilla; the image on the right side of the button is not showing up until I hover. Changing the background-position on the anchor with Firebug has NO effect. I have produced this with custom buttons, but now with the template buttons.

<telerik:RadButton ID="uxSaveTimesheetTop" runat="server"  Text="save timesheet">
    <Icon SecondaryIconCssClass="rbSave" SecondaryIconRight="6" SecondaryIconTop="4" />
</telerik:RadButton>
Bozhidar
Telerik team
 answered on 15 Nov 2010
2 answers
153 views
So my project now requires version control on documents, not just a file explorer.  I decided I could try to accommodate this by having both a file explorer and a grid, the grid being old versions of what the currently selected file in the explorer.

We are using a database on our backend and it is implemented and functional with the file explorer.  To be able to do version control I was able to modify the server side code to allow for versioning.  I have two issues, both being with the file explorer that are stopping me from implementation of version control.

1. I need to be able to communicate from the file explorer to the grid that houses historical files.  When a user clicks a file in the file explorer, I need ajax to load the historical files.  Again, I have the backend set up already to do this.  I do not see any onclick, or onClientClick methods available to use at the fileexplorer.  How can I access these events to trigger the ajax.

2. The upload that comes with File Explorer is pretty out of the box and I see no way to access it.  Whenever I try to upload a file that already exists I receive:

"A file with a name same as the target already exists!"

How can I trump this message and allow inserting into the data.  This is not an overwrite.  Since I had to extend the FileBrowserContentProvider class for my DB implementation I assume that the uploader is calling one of the methods in my custom provider, which in turn is telling the front end that the record exists.  Basically, what server side method that I over wrote does the out of the box uploader call to determine a file already exists?  Whatever method that is I need to apply code to always return that the file does not exist.

If we can resolve these two issues I will have a working File Explorer/ Grid user control that can do Version Control.

Thank you in advance for any input or help.
Jay Leffue
Top achievements
Rank 1
 answered on 15 Nov 2010
2 answers
216 views
Some skins (WebBlue, for example) have alternating colour rows enabled by default, others (including Office2007) don't.

Is it possible in a App_Theme's .skin file to enable alternating colours if the Skin setting for the RadGrid is one for which the alternating colours are usually disabled?

-- 
Stuart
Dimo
Telerik team
 answered on 15 Nov 2010
2 answers
41 views
I have 3 GridNumericColumns and 2 GridCalculated columns.  For the 1st calculated column, it is the product of GridNumericColumn1 and GridNumericColumn2.  What I need for the second GridCalculated column is to take the product of GridNumericColumn1 and GridNumericColumn2 and multitply that by 1 minus the value that is in GridNumericColumn3.  So if GridNumeric1 was 500 and GridNumeric2 was 10 and GridNumeric3 was 0.80, the calculation would be (500)*(10)*(1-0.8).  When I put the value 1 in the expression (1-0.8), it thinks I'm referring to column1, but I want this to be the number 1.  How would I go about doing this?  Thanks.
Kathy
Top achievements
Rank 1
 answered on 15 Nov 2010
1 answer
65 views
I'm doing some tests, and am having a problem with RestrictionZoneID.

When a RadWindow is opened in a window smaller than the actual RadWindow, the RadWindow is up, or I lose the option of moving the RadWindow.

I'm also using the Scheduler and this problem does not happen!
Georgi Tunev
Telerik team
 answered on 15 Nov 2010
1 answer
68 views
I have a RadRating control including in a RadGrid column defined as an ItemTemplate.
How do I dynamically add the RadRatingItem at runtime?

I have done this no problem on a single control, but what event can I capture that enables me to add the items to each RadRating created?
Tsvetie
Telerik team
 answered on 15 Nov 2010
1 answer
87 views
The radalert prompt and confirm the RestrictionZoneID no respect!
Since the windows work perfectly.

How do I fix this?
Georgi Tunev
Telerik team
 answered on 15 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?