Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
484 views
I have a DotNetNuke module that uses a RadGrid with InPlace editing. Markup follows:

        <telerik:RadGrid ID="lstInstallations" runat="server" AutoGenerateColumns="false"
            AllowPaging="true" OnNeedDataSource="lstInstallations_NeedDataSource" OnInsertCommand="lstInstallations_InsertCommand"
            OnUpdateCommand="lstInstallations_UpdateCommand" OnDeleteCommand="lstInstallations_DeleteCommand"
            OnItemCreated="lstInstallations_ItemCreated" CssClass="installation-table">
            <MasterTableView EditMode="InPlace" DataKeyNames="InstallationId" CommandItemDisplay="Bottom">
                <Columns>
                    <telerik:GridEditCommandColumn UniqueName="Edit" ItemStyle-CssClass="command-column" />
                    <telerik:GridButtonColumn CommandName="Delete" UniqueName="DeleteInstallation" ItemStyle-CssClass="command-column" />
                    <telerik:GridBoundColumn DataField="Domain" UniqueName="Domain" />
                </Columns>
            </MasterTableView>
            <ValidationSettings ValidationGroup="Installations" />
        </telerik:RadGrid>

This code worked correctly for AJAX controls for DotNetNuke v.2012.3.1205.40, but in v.2013.1.220.40, the behaviour has changed. The grid does not show a text box for the Domain column when it enters Insert mode. If you click the Insert link, it correctly shows a validation message saying that the field is required, and then gives the expected text box. If you then enter a value and click the Insert link again, you get the following error:

Editor cannot be initialized for column: Domain ---> Telerik.Web.UI.GridColumnEditorException: Editor cannot be initialized for column: Domain at Telerik.Web.UI.GridEditManager.GetColumnEditor(IGridEditableColumn column) at Telerik.Web.UI.GridBoundColumn.FillValues(IDictionary newValues, GridEditableItem editableItem) at Telerik.Web.UI.GridEditableItem.ExtractValues(IDictionary newValues) at Telerik.Web.UI.GridTableView.ExtractValuesFromItem(IDictionary newValues, GridEditableItem editedItem)

This appears to be a bug. Is there a fix for it, or a workaround, please?
Segev
Top achievements
Rank 1
 answered on 05 May 2013
1 answer
225 views
I have RadAsyncUpload inside RADgrid  edit template , before I ajaxify the control using RadAjaxManager every thing was working fine ,, but after i set it to ajax manager or sournd it between rad ajax panels the control does not appear... 
here is the code ,, 

    <radscriptblock id="RadScriptBlock1" runat="server">
<script language="javascript" type="text/javascript">
 
    function OnClientBlurHandler(sender, eventArgs) {
        var textInTheCombo = sender.get_text();
        var item = sender.findItemByText(textInTheCombo);
        //if there is no item with that text
        if (!item) {
            sender.set_text("");
        }
    }
 
</script>
<script language="javascript" type="text/javascript">
    function AddNewFields(radUpload, args) {
        var FildNameLable = '<% = Resources.TMS.UI.TM_AddNewTask_lblAttachmentFileName%>';
        var curLiEl = args.get_row();
        var firstInput = curLiEl.getElementsByTagName("input")[0];
        var input = CreateInput("Title", "text");
        input.className = "copyOfRADTextCSS";
        input.id = input.name = radUpload.getID(input.name);
        var label = CreateLabel(FildNameLable, input.id);
        var fileInputSpan = curLiEl.getElementsByTagName("span")[0];
        var firstNode = curLiEl.childNodes[0];
        curLiEl.insertBefore(label, fileInputSpan.nextSibling);
        curLiEl.insertBefore(input, label.nextSibling);
    }
 
    function CreateLabel(text, associatedControlId) {
        var label = document.createElement("label");
        label.innerHTML = text;
        label.setAttribute("for", associatedControlId);
        label.style.fontSize = 12;
 
        return label;
    }
    function CreateInput(inputName, type) {
        var input = document.createElement("input");
        input.type = type;
        input.name = inputName;
        return input;
    }
    function ConfirmMessage(MessageID) {
        var messageBody = '';
        if (MessageID == "TaskParticipateDelete")
            messageBody = '<% = Resources.TMS.UI.Confirmation_TaskDetails_TaskParticipateDeleteConfirmation%>';
        else if (MessageID == "AttachmentDelete")
            var messageBody = '<% = Resources.TMS.UI.Confirmation_TaskDetails_AttachmentDeleteConfirmation%>';
        else if (MessageID == "EndTask")
            var messageBody = '<% = Resources.TMS.UI.Confirmation_TaskDetails_EndTakConfirmation%>';
 
    return confirm(messageBody);
}
</script>
<script type="text/javascript">
    //On insert and update buttons click temporarily disables ajax to perform upload actions
    function conditionalPostback(e, sender) {
        var theRegexp = new RegExp("\.ImageButton1", "ig");
        if (sender.EventTarget.match(theRegexp)) {
            alert(sender.EventTarget.match(theRegexp));
            var upload = $find(window['UploadId']);
            alert(upload.toString());
            //AJAX is disabled only if file is selected for upload
            if (upload.getFileInputs()[0].value != "") {
                sender.EnableAjax = false;
                alert("EnableAjax = false");
            }
        }
    }
    // end insert and update issue,
 
        var uploadedFilesCount = 0;
        var isEditMode;
        function validateRadUpload(source, e) {
            // When the RadGrid is in Edit mode the user is not obliged to upload file.
            if (isEditMode == null || isEditMode == undefined) {
                e.IsValid = false;
 
                if (uploadedFilesCount > 0) {
                    e.IsValid = true;
                }
            }
            isEditMode = null;
        }
 
        function OnClientFileUploaded(sender, eventArgs) {
            uploadedFilesCount++;
        }
 
    </script>
    </radscriptblock>
<telerik:RadAjaxManager DefaultLoadingPanelID="LoadingPanel1" ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="MasterRadGrid">
            <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="MasterRadGrid"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
 
 
<telerik:RadGrid StatusBarSettings-LoadingText="جاري التحديث" CssClass="GridAlign"
                            ID="MasterRadGrid" runat="server" ShowStatusBar="true" AutoGenerateColumns="False"
                            PageSize="3" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True"
                            GridLines="None" AllowAutomaticDeletes="True" AllowAutomaticInserts="False" AllowAutomaticUpdates="false"
                            OnInsertCommand="MasterRadGrid_InsertCommand" OnDetailTableDataBind="MasterRadGrid_DetailTableDataBind"
                            OnNeedDataSource="MasterRadGrid_NeedDataSource" OnUpdateCommand="MasterRadGrid_UpdateCommand"
                            Skin="Metro" OnDeleteCommand="MasterRadGrid_DeleteCommand" OnItemDataBound="MasterRadGrid_ItemDataBound">
 <PagerStyle Mode="NumericPages"></PagerStyle>
                            <MasterTableView DataKeyNames="CommentID" AllowMultiColumnSorting="True" Width="100%"
                                CommandItemDisplay="Top" Name="MainComment">
<FormTemplate>
                                        <div id="content">
                                            <table>
                                                <tr>
                                                    <td colspan="4" style="width: 40%; padding-right: 15px">
                                                        <telerik:RadAsyncUpload Width="500px" ID="rpTaskAttachments" runat="server">
                                                        </telerik:RadAsyncUpload>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                    </FormTemplate>
 </EditFormSettings>
                            </MasterTableView>
                        </telerik:RadGrid>

Mohammad
Top achievements
Rank 1
 answered on 05 May 2013
2 answers
126 views
Dears , 
i am trying to download a file from ajaxified control , my problem is the file is saved in server network path ex(//sharedFile/Folder/File.extention).
i tried the below link but it did not work with no errors occurred. 
http://www.telerik.com/help/aspnet-ajax/ajax-download.html

any idea how is can be done ?!

Mohammad
Top achievements
Rank 1
 answered on 05 May 2013
0 answers
100 views
I have 2 entities: Passengers and IDTypes, Passenger has a navigation property called IDType (bound to IDType_ID)

How can i  build a dropdown in the formtemplate? i have one :
<asp:DropDownList ID="dropdownPassengerIDTypes" runat="server" DataSourceID="dsIDTypes" DataTextField="IDTYPE_NAME"
                                DataValueField="ID" SelectedValue='<%# Bind("IDType_ID") %>' AppendDataBoundItems="True">
                                <asp:ListItem Text="Seleccione un Tipo" Value="0"></asp:ListItem>
                            </asp:DropDownList>

BUT IDType_ID does not exists in my Passengers Entity.. can someone help me?
Nahuel
Top achievements
Rank 1
 asked on 04 May 2013
1 answer
321 views

I have RadDatePicker control with SelectedDateChanged event. When I change the Date the event fires with Confirm window. When I click on 'Cancel' button RadDatePicker1_SelectedDateChanged invokes again and it displays Confirm window twice. When I click on 'OK' button it works fine. What could be the problem? Thanks for any suggestions. I am using 2010 Q3 controls.
                       

      <telerik:RadDatePicker ID="RadDatePicker1" runat="server" AutoPostBack="true" OnSelectedDateChanged="RadDatePicker1_SelectedDateChanged" >
                             </telerik:RadDatePicker>
   
   
    protected void RadDatePicker1_SelectedDateChanged(object sender, EventArgs e)
    {
    string radalertscript = "<script language='javascript'>function f(){ radconfirm('Are you sure?', confirmChange, 400, 100) ; Sys.Application.remove_load(f);}; Sys.Application.add_load(f);</script>";
                         Page.ClientScript.RegisterStartupScript(this.GetType(), "radalert33", radalertscript);
     }

Here is Javascript function

    function confirmChange(args) {
        if (args) {
            __doPostBack("<%= hiddenButton1.UniqueID %>", "");
        }
    { var picker = $find("<%= rdpIndictment.ClientID %>");

      var hdval = document.getElementById('hiddenControlOldValue').value;

      picker.set_selectedDate(new Date(hdval));
   }
}
It looks like the problem is setting old value to Date Picker when 'Cancel' button clicked. Is there are any way I can Cancel Date Picker new selected value when 'Cancel' button clicked?

 

 

Keith
Top achievements
Rank 2
 answered on 04 May 2013
1 answer
165 views

 I have a radgrid on my page that I build programmatically within my Page_Init. I use the NeedDataSource to populate my grid. I have pagination enabled along with filtering.

When the user is on my screen the radgrid displays with information that spans multple pages. They can also use filtering to shrink the number of pages down. They will then have the ability to click on a regular asp button. This button will then try to gather all of the ids from all of the records in the radgrid. Not just the records on the current page.

An example:
    1. the radgrid has a pagination set to 100 records. the datasource has a total of 1600 records in it. So I have a radgrid of 16 pages, 100 at a time.
    2. the user uses a filter to shrink the number of pages down to 9 with a total of 850 records showing. the datasource still has 1600 because the radgrid is filtering and not the actual datasource.
    3. the user clicks the button. I want, on the server, to be able to traverse through all 850 records to get their specific datakeyitem and do something like this but the problem is the MasterTableView only has 100 records in it not the 850.

protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items)
        {
            int detailID = dataItem.GetDataKeyValue("DetailID");
            //do something with the detailID
       }
   }

What else can I do to get this? I could try to store the ids that come back during the loading of the radgrid, but to do this I think I would need to take pagination off, rebind, get the ids, put pagination back on, rebind. I don't see something like this as an option because my datasource could have high number of records and binding twice would lead to user's waiting.

Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 May 2013
1 answer
88 views


Hi,
 The Css styles are not apply for Radcontrols in IE.if i put 2 grid controls the Css styles are applied perfectly.but if i add more than two grid, css styles are not apply for other grids except first two grid.
 

To solve this i have searched in a lots of forum. 

some experts told to add a stylesheetmanager to Combine the stylesheet requests into a single request.
because of IE have some limitation to add more than 31 cssfile.
 
After adding the stylesheetmanager  i am getting the same issue.
Please help me to solve this issue.


Sample code:
  <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
        <StyleSheets>
           <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Grid.css" Assembly="Telerik.Web.UI" />
            <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Black.Grid.Black.css" Assembly="Telerik.Web.UI" />
            <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Forest.Grid.Forest.css" Assembly="Telerik.Web.UI" />
            <telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Hay.Grid.Hay.css" Assembly="Telerik.Web.UI" />
        </StyleSheets>
    </telerik:RadStyleSheetManager>

Thanks.
 
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 May 2013
3 answers
307 views
Hello,

I struggling through an IE9 specific issue. 
I have RadListBox which I am trying to get its Client ID in Jquery. The way I am doing it is recommended on telerik.com.

var lstBusinessModel = $find("<%=lbBusinessModel.ClientID %>");
var items = lstBusinessModel.get_items();

HTML markup

<telerik:RadListBox ID="lbBusinessModel" Width="200px" Height="300px" OnClientSelectedIndexChanged="BusinessModelSelected" 
 runat="server"></telerik:RadListBox>

It works perfectly fine in Chrome, Firefox, IE8, IE7. The only browser it doesn't support is IE9.

Are you guys aware of this issue?
Can you guys please look into this one and provide me the solution.

Thanks,
Saquib.
Jen Peleva
Telerik team
 answered on 04 May 2013
8 answers
503 views

How would you go about creating dynamic tooltips such as the ones found here:
http://freelance.geekinterview.com/143141-issues-with-jquery-cluetip.html

Basically I got a glossary table in my database with definitions that I want to display as a tooltip in my aspx (c#) pages wherever the a keyword will match that of the glossary..

Something basic will do, such as:
http://plugins.learningjquery.com/cluetip/demo/

Royce
Top achievements
Rank 1
 answered on 04 May 2013
1 answer
101 views
Hi,

My grid has Item Template column with controls. This kind of requirement is on many pages. Some pages have label and textbox in template column. other pages have radio button list or dropdown list. What I am trying to do is write global code to iterate through template column controls and enable or disable them.

Something like this:

private void EnableTemplateContrils(GridTemplateColumn tmpCol)
{
        bool status = false;

    foreach (cell or control in tmpCol)
   {
       enableORDisableControl(control, status);
   }
}

private void enableORDisableControl(System.Web.UI.Control pControl, bool pStatus)
{
    string controlName = pControl.GetType().Name;
    switch(controlName)
     {
         case "TextBox":
                ((WebControl)pControl).enabled = pStatus;
                break;
         case "CheckBox":

     }
}

I appreciate your response. Please let me know how to loop thru controls in template column.

Thanks,
Prathiba
Jayesh Goyani
Top achievements
Rank 2
 answered on 04 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?