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

Hello

I have a textbox with an event handler for TextBox_OnTextChanged.  I also have a RadComboBox.

When a value in TextBox changes, it does fire the TextBox_OnTextChanged event.  In this handler the RadComboBox.SelectedValue is set to either '0' or a non-zero value - which looks to be correct under the debugger. I have ajaxified it.  However, the RadComboBox selected value does not seem to be changing.  How do I get the RadComboBox to reflect the changed value?

Thanks, Raka.

 

        protected void txtName_TextChanged(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtName.Text))
            {
                rcbProgram.Enabled = true;
                rcbProgram.SelectedValue = "0";
            }
            else
            {
                rcbProgram.SelectedValue = subProgram == null ? "0" : subProgram.ProgramId.ToString();
                rcbProgram.Enabled = false;
            }
        }

Eyup
Telerik team
 answered on 20 Apr 2016
4 answers
80 views

I have two RadWindows side-by-side within a RadWindowManager. Both windows can be resized and moved, and are populated (say with some static html page). When I resize or move one of the windows by dragging the borders or titlebar, the other window that doesn't have focus blanks out for the duration of the drag. The contents reappear only when the resize/move operation is completed on the first window.

Can this behavior be modified, so that contents of the second window are visible even while the first window is being resized/moved?

I'm using version 2010.1.309.20, and my IDE is VS 2008, with .NET 3.5 SP1. The browser being used is IE 6.0.

Here is the body of my page:

<body> 
    <form id="form1" runat="server">  
    <div>      
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
      
    <telerik:RadWindowManager ID="DBRadWindowManager" runat="server">  
        <Windows> 
            <telerik:RadWindow ID="CustomerWindow" runat="server" VisibleOnPageLoad="true" TabIndex="1" ReloadOnShow="true" 
                BorderStyle="None" Behavior="Default" Height="250px" InitialBehavior="None" Left="5px"   
                Skin="Telerik" Title="CUSTOMER" Top="20px" Width="300px" NavigateUrl="Source1.htm"   
                Behaviors="Maximize,Minimize,Move,Reload,Resize" KeepInScreenBounds="true">  
            </telerik:RadWindow> 
            <telerik:RadWindow ID="OrderWindow" runat="server" VisibleOnPageLoad="True" TabIndex="2" ReloadOnShow="true" 
                BorderStyle="None" Behavior="Default" Height="250px" InitialBehavior="None" Left="400px" 
                Skin="Telerik" Title="ORDERS" Top="20px" Width="300px" NavigateUrl="Source2.htm" 
                Behaviors="Maximize,Minimize,Move,Reload,Resize" KeepInScreenBounds="true">  
            </telerik:RadWindow> 
        </Windows> 
    </telerik:RadWindowManager> 
    </div> 
    </form> 
</body> 

Thanks,
Karun.
Marin Bratanov
Telerik team
 answered on 20 Apr 2016
3 answers
68 views

I am using rad grid to load the data in a nested view and save it into the database using a generic class (get/set the data's based on the controls in the form).
After saving the data I need to reload the data back into the radgrid in the nested view (using OnDetailTableDataBind with HierarchyLoadMode=ServerBind).

I have all the required data in the form of an xml

<Rows>
  <Row> Parent View
    <SubRow>
        Child View
    </SubRow>
   </Row>
 </Rows>

Can any one please help how to set OnDetailTableDataBind event from a generic class?

Private Function SetGridControls(ByVal telerikGrid As RadGrid, ByVal gridValue As String) As RadGrid
    Dim loXML As XmlDocument = New XmlDocument
    Dim dtRowTable As DataTable
    Dim dtColumnTable As DataTable
 
    telerikGrid.AutoGenerateColumns = True
    If gridValue.Length > 0 Then
        loXML.LoadXml(gridValue)
 
        Dim elementChild As XmlNodeList = loXML.GetElementsByTagName("SubRow")
        Dim loElem As XmlElement
        Dim loAtt As XmlAttribute
        dtRowTable = New DataTable          'Contains all the ROWS
        dtColumnTable = New DataTable       'Contains all the SUBROWS
 
        Dim blnRowDT As Boolean = False    
        Dim blnColumnDT As Boolean = False
 
        dtRowTable = New DataTable()
        dtColumnTable = New DataTable()
 
        'Loading all the subrows
        Dim SubRowList As XmlNodeList = loXML.GetElementsByTagName("SubRow")
        For Each node As XmlNode In SubRowList
            If blnColumnDT = True Then
                Exit For
            End If
            For i As Integer = 0 To node.Attributes.Count - 1
                dtColumnTable.Columns.Add(New DataColumn(node.Attributes(i).Name))
            Next
            blnColumnDT = True
        Next
 
        For Each node As XmlNode In SubRowList
            Dim row As DataRow = dtColumnTable.NewRow()
            For i As Integer = 0 To node.Attributes.Count - 1
                Dim columnName As String = node.Attributes(i).Name
                Try
                    Thread.CurrentThread.CurrentCulture = USCulture
                    If Not IsNumeric(node.Attributes(i).gridValue) AndAlso IsDate(node.Attributes(i).gridValue) Then
                        row(columnName) = DateString(CDate(node.Attributes(i).gridValue), StringFormat.ShortDate)
                    Else
                        row(columnName) = node.Attributes(i).gridValue
                    End If
                Catch e As SystemException
                    row(columnName) = node.Attributes(i).gridValue
                Finally
                    Thread.CurrentThread.CurrentCulture = CultureInfo
                End Try
            Next 
        dtColumnTable.Rows.Add(row)
        Next
 
        'Loading all the rows
        For Each loElem In loXML.DocumentElement
            If (blnRowDT = True) Then
                Exit For
            End If
            For Each loAtt In loElem.Attributes
                If Not dtRowTable.Columns.Contains(loAtt.Name) Then
                    dtRowTable.Columns.Add(New DataColumn(loAtt.Name))
                End If
            Next
            blnRowDT = True
        Next
 
 
 
        Dim iRow As Integer = 1
        For Each loElem In loXML.DocumentElement
            Dim row As DataRow = dtRowTable.NewRow()
            For Each loAtt In loElem.Attributes
                Dim columnName As String = loAtt.Name
                Try
                    Thread.CurrentThread.CurrentCulture = USCulture
                    If Not IsNumeric(loAtt.gridValue) AndAlso IsDate(loAtt.gridValue) Then
                        row(columnName) = DateString(CDate(loAtt.gridValue), StringFormat.ShortDate)
                    Else
                        If loAtt.gridValue.Trim = "" And TypeOf (row(columnName)) Is Double Then
                            row(columnName) = 0
                        Else
                            row(columnName) = loAtt.gridValue
                        End If
                    End If
                Catch e As SystemException
                    row(columnName) = loAtt.gridValue
                Finally
                    Thread.CurrentThread.CurrentCulture = CultureInfo
                End Try
            Next
            dtRowTable.Rows.Add(row)
            iRow += 1
        Next
 
        'Attaching all the rows into datasource
        telerikGrid.DataSource = dtRowTable
    End If
 
    Return telerikGrid
End Function

Maria Ilieva
Telerik team
 answered on 20 Apr 2016
0 answers
55 views

We are trying to integration spell check tool with MS CRM 2011 in Email activity. This is working fine with Web Client. But when we test the same in CCD, we are unable to select the suggested options from list of given options. But if suggested options framed have scroll bar, then we are able to pick a value. And this issue appears from second time when we load spell check for a control. Appreciate any suggestions.

 

Thanks,

Raghu

Raghu
Top achievements
Rank 1
 asked on 20 Apr 2016
5 answers
195 views

hi 

How do i remove those white border line in the header? Thanks a lot

Here are my code.

  <style>
div.RadPanelBar_Default div.rpHeaderTemplate,
div.RadPanelBar_Default a.rpLink,
div.RadPanelBar_Default a.rpSelected
{
    background-image: none;
    background-color: #2C3E50;
    color:#fff;
    border-color:#2C3E50;
    border: none 0px !important; 
    font-size:medium;

}

 div.RadPanelBar_Default .rpExpanded {
    background-color: #2C3E50 !important;
    color:#fff;
    border-color:#2C3E50;
    border: none 0px !important; 
}  

 .RadPanelBar .rpRootGroup, .rpItem .rpLink   
{    
     border: none 0px !important;    
     color: #FFF;  
     text-decoration: none;  
     border-bottom-width: 0px !important; 
     padding: 0px 0px 0px 0px !important; 
}  

.RadPanelBar rpRootGroup  .rpGroup .rpItem .rpLink
   {
      color: Green;
   }
.RadPanelBar .rpOut  
{  
    border-bottom-width: 0px !important;  
}  
.RadPanelBar_Default ul li a:link, 
.RadPanelBar_Default ul li a:visited, 
.RadPanelBar_Default ul li a:hover, 
.RadPanelBar_Default ul li a:active 
{
    color: #fff;
    display: block;
    /* width: auto !important;
    float: left; */
    border-top: 0px solid #2C3E50;
    border-bottom: 0px solid #2C3E50;
    border: none 0px !important; 
 

}
.rpExpanded {
    background-color:#2C3E50  !important;
    color:#fff;
    border: none 0px !important; 
}
 
.rpSelected {
    background-color:#2C3E50  !important;
    color:#fff;
    border: none 0px !important; 
}

 
</style>
    <telerik:RadPanelBar ID="RadPanelBar1"  runat="server">
          
    </telerik:RadPanelBar>

Ivan Danchev
Telerik team
 answered on 20 Apr 2016
0 answers
107 views

Hi, everyone,when am using asynchronous telerik upload,but when i clicks on remove it disappering upload control also,please help me..am working on this since last 2 days...

this is my telrik 

@(Html.Telerik().Upload()
        .Name("attachments_" + ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))
        .Multiple(true)
        .Async(async => async
            .Save("Save", "GalleryUser", new { name = @Model, area = "" })
                .Remove("Remove", "GalleryUser", new { name = @Model, area = "" })
            .AutoUpload(true)
        )
        .ClientEvents(events => events.OnSuccess("OnSuccess_" + ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)).OnLoad("OnLoad_" + ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)))
        .HtmlAttributes(new { @class = "gallery-upload-box" })
)

 

this is my scripts related to events

<script type="text/javascript">

    var i11 = @(i1);

    function OnSuccess_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        debugger;

        if (e.operation == "upload") {
            var imgUrl = "/Image?img=/" + encodeURIComponent("Content/UserFiles/Users/@Model/" + getFileInfo(e));
            var divCont = '<div class="gallery_div '+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'
                          +i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+
                          '&w=120&h=120&t=0&c=0" alt="" /><input type="text" class="gallery_textbox"'+
                          ' id="desc_gallery_img_@(i1)_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" />'+
                          '<input type="checkbox" class="gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" id="gallery_img_'+
                          i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" /><span for="gallery_img_'+i11+
                          '_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))">מחק</span></div>';
            //var divCont = '<div class="'+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'+i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+'&w=120&h=120&t=0&c=0" alt="" /></div>';
            $(".gallery_editor_wrap_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").append(divCont);
            i11 = i11 + 1;
        }
        else if (e.operation == "remove") {
            $('div[class*="'+getFileInfo(e)+'"]').remove();
           
        }
       
      
           
        }


    var PARAM_NAME = "attachments";
    function OnLoad_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        var uploadElement = $("input", this).attr("name", PARAM_NAME);
        setTimeout(function () {
            uploadElement.data("tUpload").name = PARAM_NAME;
        }, 0);
    }

    function getFileInfo(e) {
        return $.map(e.files, function (file) {
            var info = file.name;
            return info;
        }).join(", ");
    }
</script>
@{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
        $(".gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").live("click", function(){
        var itemid = $(this).attr("id");
        var imgPaht = $("." + itemid + " img").attr("src");
        $.post("/GalleryUser/RemoveFile", { name: "@Model", fullName: imgPaht } )
        .success(function() {
        $("." + itemid).remove();
        });
        return false;
        });
</text>); }

<script type="text/javascript">

    var i11 = @(i1);

    function OnSuccess_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        debugger;

        if (e.operation == "upload") {
            var imgUrl = "/Image?img=/" + encodeURIComponent("Content/UserFiles/Users/@Model/" + getFileInfo(e));
            var divCont = '<div class="gallery_div '+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'
                          +i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+
                          '&w=120&h=120&t=0&c=0" alt="" /><input type="text" class="gallery_textbox"'+
                          ' id="desc_gallery_img_@(i1)_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" />'+
                          '<input type="checkbox" class="gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" id="gallery_img_'+
                          i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" /><span for="gallery_img_'+i11+
                          '_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))">מחק</span></div>';
            //var divCont = '<div class="'+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'+i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+'&w=120&h=120&t=0&c=0" alt="" /></div>';
            $(".gallery_editor_wrap_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").append(divCont);
            i11 = i11 + 1;
        }
        else if (e.operation == "remove") {
            $('div[class*="'+getFileInfo(e)+'"]').remove();
           
        }
       
      
           
        }


    var PARAM_NAME = "attachments";
    function OnLoad_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        var uploadElement = $("input", this).attr("name", PARAM_NAME);
        setTimeout(function () {
            uploadElement.data("tUpload").name = PARAM_NAME;
        }, 0);
    }

    function getFileInfo(e) {
        return $.map(e.files, function (file) {
            var info = file.name;
            return info;
        }).join(", ");
    }
</script>
@{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
        $(".gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").live("click", function(){
        var itemid = $(this).attr("id");
        var imgPaht = $("." + itemid + " img").attr("src");
        $.post("/GalleryUser/RemoveFile", { name: "@Model", fullName: imgPaht } )
        .success(function() {
        $("." + itemid).remove();
        });
        return false;
        });
</text>); }
<script type="text/javascript">

    var i11 = @(i1);

    function OnSuccess_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        debugger;

        if (e.operation == "upload") {
            var imgUrl = "/Image?img=/" + encodeURIComponent("Content/UserFiles/Users/@Model/" + getFileInfo(e));
            var divCont = '<div class="gallery_div '+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'
                          +i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+
                          '&w=120&h=120&t=0&c=0" alt="" /><input type="text" class="gallery_textbox"'+
                          ' id="desc_gallery_img_@(i1)_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" />'+
                          '<input type="checkbox" class="gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" id="gallery_img_'+
                          i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))" /><span for="gallery_img_'+i11+
                          '_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))">מחק</span></div>';
            //var divCont = '<div class="'+getFileInfo(e)+' gallery_div_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) gallery_img_'+i11+'_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))"><img src="'+imgUrl+'&w=120&h=120&t=0&c=0" alt="" /></div>';
            $(".gallery_editor_wrap_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").append(divCont);
            i11 = i11 + 1;
        }
        else if (e.operation == "remove") {
            $('div[class*="'+getFileInfo(e)+'"]').remove();
           
        }
       
      
           
        }


    var PARAM_NAME = "attachments";
    function OnLoad_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))(e) {
        var uploadElement = $("input", this).attr("name", PARAM_NAME);
        setTimeout(function () {
            uploadElement.data("tUpload").name = PARAM_NAME;
        }, 0);
    }

    function getFileInfo(e) {
        return $.map(e.files, function (file) {
            var info = file.name;
            return info;
        }).join(", ");
    }
</script>
@{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
        $(".gallery_img_@(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty))").live("click", function(){
        var itemid = $(this).attr("id");
        var imgPaht = $("." + itemid + " img").attr("src");
        $.post("/GalleryUser/RemoveFile", { name: "@Model", fullName: imgPaht } )
        .success(function() {
        $("." + itemid).remove();
        });
        return false;
        });
</text>); }

 

these are my action methods..

 

 public ActionResult Save(IEnumerable<HttpPostedFileBase> attachments, string name)
        {
            List<int> GalleryIds = new List<int>();
            SURoleProvider pro = new SURoleProvider();
            string roles= pro.GetRolesForUser(User.Identity.Name).FirstOrDefault();
            if (!SecurityCheck(name) && roles!="Provider") throw new HttpException(401, "error");
            string UserFolder = "~/Content/UserFiles/Users/" + name + "/";
            string UserFolderPath = Server.MapPath(UserFolder);
            CreateUserFolder(UserFolderPath);
            foreach (var file in attachments)
            {
                Random n = new Random();
                var fileName = n.Next(500,10000) + Path.GetFileName(file.FileName);
                GalleryIds.Add(SaveGalleryImageTrack(UserFolder + fileName, name));
                var physicalPath = Path.Combine(UserFolderPath, fileName);
                string[] lastPart = name.Split('/');
                if (lastPart[1].ToString().Contains("CsvFile_"))
                {
                    string[] words = fileName.Split('.');
                    string ext = words[1].ToString();
                    if(ext == "csv" || ext == "vcf")
                    {
                        file.SaveAs(physicalPath);
                    }
                }
                else
                {
                    file.SaveAs(physicalPath);
                }
               
            }
            return Content("");
        }

        public ActionResult Remove(string[] fileNames, string name)
        {
           // if (!SecurityCheck(name)) throw new HttpException(401, "error");
            string UserFolder = "~/Content/UserFiles/Users/" + name + "/"; 
            string UserFolderPath = Server.MapPath(UserFolder);
            CreateUserFolder(UserFolderPath);
            foreach (var fullName in fileNames)
            {
                var fileName = Path.GetFileName(fullName);
                var physicalPath = Path.Combine(UserFolderPath, fileName);
                if (System.IO.File.Exists(physicalPath))
                {
                    System.IO.File.Delete(physicalPath);
                    RemoveFileRecordFromDB(UserFolder + fileName);
                    
                }
            }
            return Content("");
        }

anitha
Top achievements
Rank 1
 asked on 20 Apr 2016
3 answers
258 views
Some of our projects are very long, and our users would like to export just what is viewable on page web page to PDF. So, it would essentially be a narrow sliver of the entire Gantt chart, but every task (row) would be show. For example, show only a Gantt chart for the next 2 months of tasks, instead of the entire project. We thought about just pulling in a subset of tasks, but then we need to handle things like tasks that included in the next 2 months, then changing their start and end dates accordingly. However, we were hoping there was an easier way to set the start and end date of the entire Gantt chart so we can export just the time frame we are focusing on.
Ivan Danchev
Telerik team
 answered on 20 Apr 2016
2 answers
106 views

Hi

In a std combo box with check boxes as you select a few items the text value appears in the combobox text area, until its full then is says n selected.

I have a treeview in a combo box, with check boxes, how would I replicated this behaviour?

Andy

Andy Green
Top achievements
Rank 2
 answered on 20 Apr 2016
1 answer
135 views

Hey,

is it possible to get the selected keyvalue of a DataForm control as a <asp:ControlParameter...> of a SqlDataSource?

I know there a various other ways to accomplish this task, I was just wondering where i could find a property-overview or something like that :-)

 

Best regards,

Chris

Eyup
Telerik team
 answered on 20 Apr 2016
4 answers
242 views

Hi,

I have a RadTreelist with treelist select column.I have 6 rows in a RadTreelist.My requirement is to hide checkboxes in 2 rows based on a condition.How can hide checkbox in a row? and in which event is used for this purpose?I have given My code below.

 

<telerik:RadTreeList ID="RadTreeList1" runat="server" OnNeedDataSource="RadTreeList1_NeedDataSource"

 

AutoGenerateColumns="false" AllowMultiItemSelection="true"

 

AllowPaging="false" AllowSorting="true" DataKeyNames="ID"

 

ParentDataKeyNames="PID" AlternatingItemStyle-BackColor ="#EFF5FB" ItemStyle-BackColor="#E0ECF8" ShowTreeLines="true" OnItemDataBound="RadTreeList1_ItemDataBound" Width="100%">

 

<SelectedItemStyle CssClass="SelectedRow" />

 

<Columns>

 

 

<telerik:TreeListBoundColumn DataField="ID" UniqueName="ID" HeaderText="Bound Column" />

 

<telerik:TreeListSelectColumn HeaderStyle-Width="40px" >

 

</telerik:TreeListSelectColumn>
</telerik:RadTreeList >

Thanks,
Sindu.

S
Top achievements
Rank 1
 answered on 19 Apr 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?