Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
194 views
Hi,

my requirement is to show list of values in a grid and when the user clicks on one of the columns, I have to display a radbutton. this button is on the page and is outside the grid
I am getting the commandname in the itemcommand event and trying to make radbutton visible.  button.visible=true. when i debug the code it looks like its working but the button is not diplayed. this button is invisible by default.
do i have to do a find control like i do for the controls inside the grid? if so what is the syntax for it?

Thanks.



rms
Top achievements
Rank 1
 answered on 08 May 2012
5 answers
157 views
I have a RadListView nested within a RadListView. The inner RadListView has LinkButtons for copying/deleting/organizing the elements. When the LinkButtons are clicked, the events fire and I copy/delete/reorganize the data, but the page doesn't get updated. If I refresh the page or execute another command, the data is refreshed...but it's always one click behind. It's obviously an event sequence and after lots of searching it sounds like I need to use the AjaxManager. I've been wresting with this too long and need help.

ASPX
I included surrounding controls just in case this affected the solution. The issues I'm having are with rlvGroups,

<telerik:RadMultiPage ID="rmpTabs" runat="server" SelectedIndex="0" Width="100%">
    <telerik:RadPageView ID="rpv1" runat="server">
        Page title: <asp:TextBox ID="txtTitle" runat="server"></asp:TextBox>
    </telerik:RadPageView>
    <telerik:RadPageView ID="rpv2" runat="server">
        <asp:Panel ID="pnlNotRelevant" runat="server">
        </asp:Panel>
    </telerik:RadPageView>
    <telerik:RadPageView ID="rpv4" runat="server">
        <asp:Panel ID="pnlItems" runat="server">
            <telerik:RadListView ID="rlvGroups" runat="server" OnItemDataBound="rlvGroups_ItemDataBound"
                Width="100%">
                <ItemTemplate>
                    <%# DataBinder.Eval(Container.DataItem, "Name")%>
                    <br />
                    <telerik:RadListView ID="rlvItems" runat="server" OnItemDataBound="rlvItems_ItemDataBound"
                        Width="100%">
                        <ItemTemplate>
                            <%# DataBinder.Eval(Container.DataItem, "Title")%>
                            <asp:LinkButton ID="lbUp" runat="server" OnCommand="lbUp_Command"><img src="arrow-up.png" /></asp:LinkButton>
                            <asp:LinkButton ID="lbDown" runat="server" OnCommand="lbDown_Command"><img src="arrow-down.png" /></asp:LinkButton>
                            <asp:LinkButton ID="lbEdit" runat="server" OnCommand="lbEdit_Command"><img src="edit.jpg" /></asp:LinkButton>
                            <asp:LinkButton ID="lbCopy" runat="server" OnCommand="lbCopy_Command"><img src="copy.jpg" /></asp:LinkButton>
                            <asp:LinkButton ID="lbDelete" runat="server" OnCommand="lbDelete_Command"><img src="delete.png" /></asp:LinkButton>
                        </ItemTemplate>
                    </telerik:RadListView>
                    <asp:LinkButton ID="lbAddPage" runat="server" Text="Add Page" OnCommand="lbAddPage_Command" />
                    <br />
                    <br />
                </ItemTemplate>
            </telerik:RadListView>
            <asp:LinkButton ID="lbAddGroup" runat="server" Text="Add Group" OnCommand="lbAddGroup_Command" />
        </asp:Panel>
    </telerik:RadPageView>
</telerik:RadMultiPage>

C#
Data is loaded from custom classes:
private void RefreshGroupsItems()
{
    rlvGroups.DataSource = tab.ViewX.Groups.Group;
    rlvGroups.DataBind();
}

protected void rlvGroups_ItemDataBound(object sender, RadListViewItemEventArgs e)
{
    if (e.Item.ItemType == RadListViewItemType.DataItem || e.Item.ItemType == RadListViewItemType.AlternatingItem)
    {
        //Get datarow
        Group group = (Group)(((RadListViewDataItem)e.Item).DataItem);

        //Find controls
        RadListView rlvItems = (RadListView)e.Item.FindControl("rlvItems");
        LinkButton lbAddPage = (LinkButton)e.Item.FindControl("lbAddPage");

        //Populate controls
        List<ListItem> data = DataHelpers.BuildListItem(group);
        rlvItems.DataSource = data;
        rlvItems.DataBind();
        lbAddPage.CommandArgument = group.ID.ToString();
    }
}

protected void rlvItems_ItemDataBound(object sender, RadListViewItemEventArgs e)
{
    if (e.Item.ItemType == RadListViewItemType.DataItem || e.Item.ItemType == RadListViewItemType.AlternatingItem)
    {
        //Get datarow
        ListItem item = (ListItem)(((RadListViewDataItem)e.Item).DataItem);

        //Find controls
        LinkButton lbUp = (LinkButton)e.Item.FindControl("lbUp");
        LinkButton lbDown = (LinkButton)e.Item.FindControl("lbDown");
        LinkButton lbEdit = (LinkButton)e.Item.FindControl("lbEdit");
        LinkButton lbCopy = (LinkButton)e.Item.FindControl("lbCopy");
        LinkButton lbDelete = (LinkButton)e.Item.FindControl("lbDelete");

        //Populate controls
        lbUp.CommandArgument = item.ID.ToString();
        lbDown.CommandArgument = item.ID.ToString();
        lbEdit.CommandArgument = item.ID.ToString();
        lbCopy.CommandArgument = item.ID.ToString();
        lbDelete.CommandArgument = item.ID.ToString();
    }
}

Please help!
Andrey
Telerik team
 answered on 08 May 2012
1 answer
70 views
hi all,

well i have a question, i am using a telerik RadGrid to bind the data from the server end and i need the filter that data on the client end without hitting the server again i.e. without getting the data back from database.

i know it is possible with using columns and binding the data back with GridBoundColumn but my problem is that i am using ItemTemplate within which i am creating the table to make it look just like my client needs, so is it possible to filter the data in the ItemTemplate without columns(gridboundcolumns).

i hope i make sense out of it.

Thanks in advance, 

waiting for the possible solution asap.

Gaurav Sharma
Andrey
Telerik team
 answered on 08 May 2012
4 answers
132 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
79 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
278 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
74 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
76 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
249 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
73 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?