Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
123 views
Hello,
I am using Jquery in RadGrid which is in RadAjaxPanel.
When I come for the first, Jquery is working fine.
If I do some calculation and page got postback, the same Jquery is not working.
RadGrid is in RadAjaxPanel and Jquery slider is in RadGrid.
What I have to do ?

TIA
Atchut
Top achievements
Rank 1
 answered on 08 May 2012
1 answer
70 views
I have the following scenario:
1. Editor is configured to use p tags as a line-breaks
2. insert the following HTML:
<div style="border-bottom: #ccc 1px solid; padding-bottom: 5px; background-color: #f7fafb; padding-left: 15px; padding-right: 10px; border-top: #ccc 1px solid; padding-top: 0px;">
<h5>On this page</h5>
<ul>
    <li>item one</li>
</ul>
</div>
3. switch to the design view and press enter after the item one node to add another list item
4. check the HTML

Result:
div tag is replaced with p one:
<p style="border-bottom: #ccc 1px solid; padding-bottom: 5px; background-color: #f7fafb; padding-left: 15px; padding-right: 10px; border-top: #ccc 1px solid; padding-top: 0px;">
<h5>On this page</h5>
<ul>
    <li>item one</li>
    <li></li>
</ul>
</p>
The browser is Internet Explorer 9

How can I make the editor not to replace div tag?
Rumen
Telerik team
 answered on 08 May 2012
7 answers
236 views
Hello,

In my grid I have several columns with items. To edit the items I use the popup editform. Some of the items in the grid I want to hide on the popup editform. Although I searched the forum and tried several solutions the problem is still there.

Here's my .aspx code:
<telerik:RadGrid ID="gvTasksDataSteward" runat="server" AutoGenerateColumns="False" 
            DataSourceID="dsTasks" GridLines="None" Skin="Office2007" > 
            <ClientSettings EnablePostBackOnRowClick="true">  
            <Selecting AllowRowSelect="true" /> 
        </ClientSettings> 
            <MasterTableView DataSourceID="dsTasks" Name="DatastewardTasks" DataKeyNames="TaskId" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" EditMode="PopUp">  
                <RowIndicatorColumn Visible="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn Visible="False" Resizable="False">  
                    <HeaderStyle Width="20px"></HeaderStyle> 
                </ExpandCollapseColumn> 
                <Columns> 
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandProject" > 
                        <HeaderStyle Width="20px" /> 
                    </telerik:GridEditCommandColumn> 
                <telerik:GridBoundColumn DataField="TaskId" HeaderText="TaskId" UniqueName="TaskId" Visible="false"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="CompanyName" HeaderText="Company" SortExpression="Company" UniqueName="Company"></telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="ProjectName" HeaderText="Project" SortExpression="ProjectName" UniqueName="ProjectName"></telerik:GridBoundColumn> 
         <telerik:GridBoundColumn DataField="TaskDescription" HeaderText="TaskDescription" 
                        SortExpression="TaskDescription" UniqueName="TaskDescription">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks" 
                        UniqueName="Remarks">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime" HeaderText="StartDate" 
                        SortExpression="StartDate" UniqueName="StartDate" DataFormatString="{0:d}">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="SoortBewerking" HeaderText="SoortBewerking" SortExpression="SoortBewerking" 
                        UniqueName="SoortBewerking">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="RealHours" DataType="System.Decimal" HeaderText="RealHours" 
                        SortExpression="RealHours" UniqueName="RealHours" Visible="false">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="StatusId" UniqueName="StatusId" Visible="false"></telerik:GridBoundColumn> 
                      
                      
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Accept" Text="Accept" ImageUrl="~/Images/OK.png" ShowInEditForm="false" CommandName="Accepted"></telerik:GridButtonColumn> 
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="NotAccept" Text="Not Accept" ImageUrl="~/Images/OK.png" ShowInEditForm="false" CommandName="NotAccepted"></telerik:GridButtonColumn> 
                    <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="Executed" Text="Executed" ImageUrl="~/images/11new.gif" ShowInEditForm="false" CommandName="Executed" ConfirmText="Executed?"></telerik:GridButtonColumn> 
 
                </Columns> 
                <EditFormSettings CaptionFormatString="Edit: {0}" CaptionDataField="ProjectName">  
                    <PopUpSettings ScrollBars="Auto" ></PopUpSettings>  
                    <EditColumn ButtonType="ImageButton" CancelText="Cancel Edit" UpdateText="Update Task" 
                        InsertText="Insert User" UniqueName="EditCommandColumn">  
                    </EditColumn> 
                    <FormTableButtonRowStyle HorizontalAlign="Right"></FormTableButtonRowStyle> 
                </EditFormSettings> 
            </MasterTableView> 
        </telerik:RadGrid> 

And here's one of the solutions I've tried:

 

Protected Sub gvTasksDataSteward_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles gvTasksDataSteward.PreRender

 

       
        For Each item As GridDataItem In gvTasksDataSteward.EditItems  
            Dim itemToEdit As GridEditableItem = If((item.OwnerTableView.EditMode = GridEditMode.PopUp), DirectCast(item, GridEditableItem), DirectCast(item.EditFormItem, GridEditableItem))  
 
            itemToEdit("StatusId").Visible = False 
        Next
End sub

Toby
Top achievements
Rank 1
 answered on 08 May 2012
0 answers
66 views
Hi,

I have a grid with group headers, i need to do expand all/collapse all as well as ensure the normal expand/collapse works too. I achieved expand all/collapse all via the below js:

        var EXPAND_CSS_CLASS = "<%=CSSConstants.EXPAND_EXPERIENCE_CSS%>";//rgExpand
        var COLLAPSE_CSS_CLASS = "<%=CSSConstants.COLLAPSE_EXPERIENCE_CSS%>";//rgCollapse
       
        //Expands or collapses all group headers based on expandCollapseClass
        function ExpandCollapseAllGroups(isExpand) {
            var sourceClass = (isExpand) ? EXPAND_CSS_CLASS : COLLAPSE_CSS_CLASS;
            var destinationClass = (isExpand) ? COLLAPSE_CSS_CLASS : EXPAND_CSS_CLASS;
            var toolTip = "<%=Tokens.CandidateExpandGroupToolTipText %>";
            if (isExpand) {
                toolTip = "<%=Tokens.CandidateCollapseGroupToolTipText %>";
            }
            // change the +/- states
            $("." + sourceClass).each(function(button) {
                $(this).removeClass(sourceClass).addClass(destinationClass);
                //change the tool tip for expand/collapse buttons
                $(this).attr("title", toolTip);
            });
            // hide/show the rows
            $("#<%=m_UIExperienceGrid.ClientID %> .<%=CSSConstants.GRID_ROW_CSS %>, #<%=m_UIExperienceGrid.ClientID %> .<%=CSSConstants.GRID_ALT_ROW_CSS %>").each(
                function(button) {
                    if (isExpand) {
                        $(this).show();
                    } else {
                        $(this).hide();
                    }
            });
            //return false to prevent postbacks
            return false;
        }

The issue is, i am unable to do an individual expand/collapse due to the mark up for grid being tampered by some highlight javascript functionality built in our application which will merely add span tags around the keywords i search to highlight in my application. The keywords i search corresponds to words displayed in the header item of the grid. Once the markup is tampered, the telerik grid individual expand/collapse breaks. Hence i need to somehow remove the telerik generated expand/collapse js associated with the input tags that bear the class "rgExpand" or  "rgCollapse" and add custom js to expand/collapse the groups individually. I tried the below js, it is not working

    $(".<%=CSSConstants.EXPAND_EXPERIENCE_CSS%>, .<%=CSSConstants.COLLAPSE_EXPERIENCE_CSS%>").attr('onclick', '');
$(".<%=CSSConstants.EXPAND_EXPERIENCE_CSS%>, .<%=CSSConstants.COLLAPSE_EXPERIENCE_CSS%>").each(
        function() {
            $(this)[0].onclick = function() {
                //TODO: if you need to know if the element is expanded, use the next line of code... otherwise remove it
                //var isExpanded = $(this).attr("class") == "rgCollapse";
                $(this).parents("TR.<%=CSSConstants.GRID_ROW_GROUP_HEADER_CSS %>").next("TR").toggle();
            }
        });

Please suggest me a solution as i have pretty much exhausted all the options.

Thanks and regards,
Damodar
Damodaran
Top achievements
Rank 1
 asked on 08 May 2012
1 answer
67 views
I have a RadTextBox that is using the jQuery UI autocomplete feature for specific values. This works great in Firefox & Chrome but when I go to select an item from the autocomplete values it does not fill the value in IE 9. Unsure why it doesn't work or what I need to do to make it work.

'<script type="text/javascript">
        $(function () {
            var availableTags = [
            "ActionScript",
            "AppleScript",
            "Asp",
            "BASIC",
            "C",
            "C++",
            "Clojure",
            "COBOL",
            "ColdFusion",
            "Erlang",
            "Fortran",
            "Groovy",
            "Haskell",
            "Java",
            "JavaScript",
            "Lisp",
            "Perl",
            "PHP",
            "Python",
            "Ruby",
            "Scala",
            "Scheme"
        ];
            $(".riTextBox").autocomplete({
                source: availableTags
            });
        });

       
    </script>'


'<telerik:RadTextBox AutoCompleteType="Search" columns="25" ID="nihSearch" runat="server" CssClass="homeSearchBox" EmptyMessageStyle-CssClass="empty" EmptyMessage="Add Keywords...">
                                </telerik:RadTextBox> '
Maria Ilieva
Telerik team
 answered on 08 May 2012
3 answers
213 views
I have a menu of requirements and I want to change the text or background color for requirements that are no longer current.

How can I do this in code behind?
Kate
Telerik team
 answered on 08 May 2012
1 answer
58 views
Hi,
Can any one please suggest which is better from Performance point of view for RADCombo.
Because after 'googling' I found that my first approach is better for small data lets say 100 or 1000 rows.

Example: Here is link what they discuss
http://forums.asp.net/t/1670292.aspx/1


 

 

Dim Item As RadComboBoxItem

 

 

 

For Each row As DataRow In DataTable.Rows
Item = New RadComboBoxItem

 

Item.Text = row("name").ToString()

Item.Value = row("id").ToString()
Combo.Items.Add(Item)

 

 

Next

OR

Combo.DataSource=DataTable
Combo.DataTextField="name"
Combo.DataValueField="id"
Combo.DataBind()


Thanks,
Sanjeev Kumar

 

Dimitar Terziev
Telerik team
 answered on 08 May 2012
3 answers
135 views
Indent, outdent is not working for single line of text in Firefox 6.0 and above browser versions.

I went to Rad editor demo site. (http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx), opened site on Firefox 6.0 browser version

In editor , entered single line of text and i did indent and outdent functionality. But this functionality is not working. Please resolve this issue.
Rumen
Telerik team
 answered on 08 May 2012
3 answers
190 views
Hello,

I'm looking for a way to create custom headercontextmenu's for some columns within a grid, and basically create a custom filter menu.
I've implemented most of the functionality as described in this article (http://www.telerik.com/help/aspnet-ajax/grid-header-context-menu.html) and it works fine, however the contextmenu is the same for all the columns, and i can't seem to figure out how to create a unique one for each column.

what i ultimatly want is a headercolumn context menu in the same fashion as an excel filter (see excelfilter.png), very similar to the way the default headercontextmenu implements the show/hide functionality.

can anyone point me in the right direction on how to do this?

thnx!

Oliver Oswald
Top achievements
Rank 1
 answered on 08 May 2012
5 answers
412 views
Hello,
I'm trying to implement an infinite scrolling method. I'm trying to use the method described on this page:http://www.fieg.nl/infinite-ajax-scroll-a-jquery-plugin That method basically takes your pagination links and uses those to get the next batch of records when the user scrolls to the bottom of the page. I seem to be running into some sort of conflict with this and the radrating control. With the radrating control enabled on the page, i get the above error (Invalid JSON primitive) when ever i cause a post back. It can either be a postback caused by a .net control set to autopostback=true, or it just be a simple html submit button. Also, the rad rating controls stop working once you go past the first page of records. 

If i remove the rad rating control from the page, then the scrolling and doing a postback work as expected. 

The rating control is inside of a .net listview. The only code on page load which that I have that deals with the rating control is this:

protected void ListView1_ItemCreated(object sender, ListViewItemEventArgs e)
{
    if (e.Item.ItemType == ListViewItemType.DataItem )
    {
        ListViewDataItem myDataItem = (ListViewDataItem)e.Item;
 
        System.Web.UI.WebControls.DataKey myKey = this.ListView1.DataKeys[myDataItem.DisplayIndex];
 
        Decimal rating = (Decimal)ListView1.DataKeys[myDataItem.DisplayIndex]["Rating"];
        string id = ListView1.DataKeys[myDataItem.DisplayIndex]["ID"].ToString();
 
        RadRating myRad = (RadRating)e.Item.FindControl("RadRating1");
        myRad.Value = rating;
        myRad.Attributes["GameId"] = id;
 
    }
}
 
And this code seems to work correctly as i scroll down the page - it's getting fired every time you scroll to the bottom of the page and it appears to be passing correct values. However, my rating_changed event never fires once you scroll past the first page.

I have an idea as to why this is happening. Since this infinite scroll works by essentially loading the next page and then appending just the specific html involved with the page, i think there's 2 errors this causes.

1. The control ID's are getting duplicated because as far as the .net page knows, it's loading up a new page. So if the last ID on the first page was radrating1_5, when i load the next page, it has no reason not to re-use that ID since it think it's a new page.

2. Any script associated with these controls isn't being properly loaded since it's not included inside the content tags where the page data lives. And that infinite scroll only loads what's inside the content container div.

So i have a few questions

1. anyone know of an infinite scrolling plugin that'll work on a page with multiple rad rating controls?
2. if not, would there be any problem if i set the control id's in codebehind with each page load so that i can ensure each control has a unique ID?
3. Is there any way to control where all the javascript gets rendered for each control? Because I have a feeling any infinite scroll plugin will have a problem with the jscript code loading outside of where the content loads.
Manesh
Top achievements
Rank 2
 answered on 08 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?