Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
756 views
Hello,

For some reason, the RadTextBox is not re-enabling.  I initially disable it with this code:

notLinkingTextBox.set_value("");
notLinkingTextBox.set_enabled(false);

Later on, a process checks to see whether a radcombobox has a particular value, and enables or disables the textbox with:

if (sender.get_value() == "5") {
textbox.enable();
}
else {
textbox.set_value("");
textbox.disable();
}

I've also tried:

if (sender.get_value() == "5") {
textbox.set_enabled(true);
}
else {
textbox.set_value("");
textbox.set_enabled(false);
}

But none of these are bringing them back... so what is the way to reenable the textbox?  I verified it is hitting the enable code (enable() method or set_enabled(true) method), so what do I need to do?

Thanks.
Pavel
Telerik team
 answered on 17 Feb 2011
3 answers
412 views
Hi,

I am working on a project that have developed by previous developers. In this project, there is a RadGrid which is used to manage the members. The member details are fetched from the database using a stored procedure and is binding it to the RadGrid. When the number of members is large, it takes a very long time to load the grid. I have checked the code and found that the ItemDatabound event of the grid creates the problem. There are some checking in this event which required to load the values in the grid. The html part of the grid is :

 

<telerik:RadGrid ID="radGvMembers" runat="server" AllowPaging="True" AutoGenerateColumns="false"
                            GridLines="None" OnNeedDataSource="radGvMembers_NeedDataSource" AllowAutomaticDeletes="True"
                            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowSorting="true"
                            AllowFilteringByColumn="True" OnUpdateCommand="radGvMembers_UpdateCommand" OnDeleteCommand="radGvMembers_DeleteCommand"
                            OnInsertCommand="radGvMembers_InsertCommand" OnItemCommand="radGvMembers_ItemCommand"
                            OnItemDataBound="radGvMembers_ItemDataBound" OnPreRender="radGvMembers_PreRender"
                            AllowMultiRowSelection="true" OnPageIndexChanged="radGvMembers_PageIndexChanged"
                            OnGridExporting="radGvMembers_GridExporting" Width="780px" OnSortCommand="radGvMembers_SortCommand">
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView DataKeyNames="MemberId,IsBounced" CommandItemDisplay="Top" AllowCustomSorting="false"
                                Width="100%">
                                <ExpandCollapseColumn>
                                    <HeaderStyle Width="20px" />
                                </ExpandCollapseColumn>
                                <CommandItemTemplate>
                                    <div>
                                        <table width="100%">
                                            <tr>
                                                <td align="left">
                                                    <asp:LinkButton ID="linkAddButton" runat="server" CommandName="InitInsert">Add New Member</asp:LinkButton>
                                                </td>
                                                <td align="right">
                                                    <asp:LinkButton ID="linkRefresh" runat="server" CommandName="RebindGrid">Refresh</asp:LinkButton>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                </CommandItemTemplate>
                                <Columns>
                                    <telerik:GridClientSelectColumn DataType="System.Boolean">
                                    </telerik:GridClientSelectColumn>
                                    <telerik:GridEditCommandColumn ButtonType="ImageButton" DataType="System.Guid" UniqueName="EditColumn">
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" ConfirmDialogType="RadWindow"
                                        ConfirmText="Do you want to delete?" ConfirmTitle="Delete" Text="Delete" CommandArgument="MemberId"
                                        CommandName="Delete" UniqueName="DeleteColumn">
                                    </telerik:GridButtonColumn>
                                    <telerik:GridTemplateColumn UniqueName="ReinstateMember" AllowFiltering="false">
                                        <ItemTemplate>
                                            <asp:ImageButton ID="btnReinstateMember" runat="Server" CommandName="ReInstate" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn UniqueName="Subscribe" AllowFiltering="false" HeaderText="IsSubscribed"
                                        SortExpression="IsSubscribed" DataField="IsSubscribed" DataType="System.Boolean">
                                        <ItemTemplate>
                                            <asp:CheckBox ID="IsSubscribed" runat="server" Checked='<%#Eval("IsSubscribed")%>'
                                                Enabled="false" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="IsBounced" SortExpression="IsBounced" AllowFiltering="false"
                                        UniqueName="BounceMember">
                                        <ItemTemplate>
                                            <asp:LinkButton ID="btnBounceMember" runat="Server" CommandName="BounceMember" Text="Button" />
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px" />
                                </RowIndicatorColumn>
                                <EditFormSettings>
                                    <EditColumn UniqueName="EditCommandColumn1">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableTheming="True">
                                <CollapseAnimation Duration="200" Type="OutQuint" />
                            </FilterMenu>
                            <ExportSettings ExportOnlyData="false" OpenInNewWindow="true" IgnorePaging="true">
                            </ExportSettings>
                            <ClientSettings AllowColumnHide="false">
                                <Scrolling AllowScroll="True" UseStaticHeaders="True"></Scrolling>
                                <Selecting AllowRowSelect="True" />
                            </ClientSettings>
                        </telerik:RadGrid>

and the code in the ItmeDataBound event is:

protected void radGvMembers_ItemDataBound(object sender, GridItemEventArgs e)
        {
            try
            {
                if (e.Item is GridDataItem)
                {
  
                    ImageButton btnReinstate = ((GridDataItem)e.Item).FindControl("btnReinstateMember") as ImageButton;
                    if (e.Item.Cells[6].Text == "True")
                    {
                        e.Item.Cells[1].Text = String.Empty;
                        e.Item.Cells[2].Text = String.Empty;
                        e.Item.Cells[4].Visible = false;
                        e.Item.Cells[6].Text = string.Empty;
                        e.Item.Cells[3].Enabled = false;
                        btnReinstate.ImageUrl = "~/App_Themes/Default/Grid/undo.jpg";
                        btnReinstate.OnClientClick = "return radconfirmWindow('Are you sure want to Re-Instate the Member'," +
                                                  "'" + btnReinstate.UniqueID + "','100','300','Member Management');";
                        (e.Item as GridDataItem).BackColor = System.Drawing.Color.Gray;
                    }
                    else
                    {
                        e.Item.Cells[6].Visible = false;
                        btnReinstate.Visible = false;
                    }
  
  
                    bool BouncedMemberStatus = Convert.ToBoolean(e.Item.OwnerTableView.DataKeyValues[e.Item.
                                        ItemIndex]["IsBounced"].ToString());
  
                    LinkButton btnBounced = ((GridDataItem)e.Item).FindControl("btnBounceMember") as LinkButton;
                    btnBounced.CommandArgument = BouncedMemberStatus.ToString();
                    btnBounced.Width = Unit.Pixel(80);
  
                    //Set Client Script
                    if (BouncedMemberStatus)
                    {
                        btnBounced.Text = "UnBounce";
                        btnBounced.OnClientClick = "return radconfirmWindow('Are you sure want to UnBounce the Member'," +
                                                   "'" + btnBounced.UniqueID + "','100','300','Bounce Management');";
                    }
                    else
                    {
                        btnBounced.Text = "Bounce";
                        btnBounced.OnClientClick = "return radconfirmWindow('Are you sure want to Bounce the Member'," +
                                                   "'" + btnBounced.UniqueID + "','100','300','Bounce Management');";
                    }
                }
                else if (e.Item is GridHeaderItem || e.Item is GridFilteringItem || e.Item is GridFooterItem)
                {
                    e.Item.Cells[6].Visible = false;
                    if (e.Item is GridHeaderItem)
                    {
                        CheckBox chk = ((GridHeaderItem)e.Item).FindControl("headerChkbox") as CheckBox;
                        if (chk != null)
                        {
                            chk.Checked = AreAllMembersSelected;
                        }
                    }
                }
            }
            catch (Exception Excep)
            {
                logger.Error("Error Trace on  " + System.Reflection.MethodBase.GetCurrentMethod().Name, Excep);
                Response.Redirect("~/ErrorPages/GenericErrorShow.aspx?msg=" + Excep.Message);
            }
        }

How can we speed up the execution of the page? Please advice me.

Manu
Top achievements
Rank 1
 answered on 17 Feb 2011
1 answer
114 views
I have a RadGrid set up for filtering.  I would like the page to postback (preferably via ajax) when a new filter is applied by the user.  I've searched through the documentation and there doesn't seem to be any sort of "OnFilterApplied" or "OnFilterApplying" event.  How can I accomplish this? 
Shinu
Top achievements
Rank 2
 answered on 17 Feb 2011
2 answers
402 views
Even with a script manager I'm still getting WebResource.axd requests for js files that include:
  • function WebForm_FindFirstFocusableChild(control)
  • function WebForm_PostBackOptions
Any idea how I can get those documents handled by the script manager?

Thanks!
msigman
Top achievements
Rank 2
 answered on 17 Feb 2011
2 answers
258 views
I have a radgrid using the automatic operations (insert/update/delete).  I have two columns in the grid called "ModifiedBy" and "DateCreated" When in edit mode and after the update button is clicked, I need to update the values of those columns for the selected item with the current logged in user and current date.  I know how to get the logged in user and date but I'm not clear on how to  bind that data back to the database.

How can this be done in the code-behind using vb.net?  I've tried to use e.Item.OwnerTableView.PerformUpdate() but I'm not sure how to do it.  Is there a better way to accomplish this?  Any help would be greatly appreciated.

 

Ryan Eaves
Top achievements
Rank 1
 answered on 17 Feb 2011
8 answers
937 views

I have a form with 3 text boxes.  Under this is a RadGrid that is dynamically created, each row represents an entity(ie. User) and each column represents a Permission (Create, Edit, Read, Delete).  Each cell is populated with a user control that tracks the permission setting for each item in the matrix (User:Create =  value1, User:Edit = value2, User:Read = value3, User:Delete = value4)

The entire grid forms part of the edit form, so every row of the grid is in "edit" mode all the time, but I am not using the EditMode of RadGrid.  Rows are not edited/saved individually.  The user may load the matrix, change values in row 1, column 2, row 3 column 4, etc.  and then click the save button.

How can I on postback loop through rows and columns and extract the new values for the matrix?


            foreach (GridDataItem gridRow in this.uxRadGridEntityPermissions.MasterTableView.Items)
            {
TableCell cell = gridRow["permissionColumnName1"]; // returns the cell
TableCell cell = gridRow["permissionColumnName2"]; // returns the cell
TableCell cell = gridRow["permissionColumnName3"]; // throws exception - index out of range
TableCell cell = gridRow["permissionColumnName4"]; // throws exception - index out of range

TableCell cell = gridRow["permissionColumnName1"]; // returns the cell




TableCell cell = gridRow["permissionColumnName1"]; // returns the cell
}

The above code works in the Init event (all cells can be retrieved) but in the button Click event, only the first 2 cells can be retrieved?
Chris @ Intrinsic
Top achievements
Rank 1
 answered on 17 Feb 2011
0 answers
131 views
hello

    i have created a nodetemplate for a comments system. (this is part of my code)
    my problem is that the text inside the div or in any element is not acting regulary like when its
    not in a nodetemplate.
    the text inside the div is not selectable, i cant select text in it and like copy or somthing like that.
    why its acting like that?
    <telerik:RadTreeView runat="server" ID="RadTreeView1" Skin="Vista">    
        <NodeTemplate>        
        <div style="width:400px;" dir="rtl">
            <div id="CommentTopSection" runat="server" style="cursor: pointer; font-size: 12px; width:100%;
                color: Black; font-family: Arial; text-align: right;">
                  
                <asp:Label ID="lbl_CommentID" runat="server" Text='<%# Eval("CommentID") %>' Visible="False"></asp:Label>
                <asp:Label ID="lbl_CommentNumer" runat="server" Text='<%# Eval("CommentIncerment") %>'></asp:Label>
                <asp:Label ID="lbl_CommentTitle" runat="server" Text='<%# Eval("CommentTitle") %>'></asp:Label>
                <br />
                  
                <span style="font-size: 12px; color: Gray; font-family: arial;"><%# Eval("Name") %> , <%# Eval("CommentDate") %>
                </span>
            </div>
            <div id="CommentExpand" runat="server"
                 style="padding-bottom:5px; font-family:Arial; font-size:12px; color:Black; text-align:right; visibility: hidden; height: 0px; width: 400px; border: 1px 1px 0px 1px solid #C0C0C0; background-color: #F1F5FA">
                <br />
                  
                <%# Eval("CommentContent") %>
                      
                <br /> <br />
                  
                <span id="span_AddNewComment" runat="server" style="padding-left:10px; cursor:pointer; font-family:Arial; font-size:12px; font-weight:bold; text-decoration:underline; color:Black;"> ????? ???? </span>      
                <span id="span_AddParentComment" runat="server" style="cursor:pointer;  font-family:Arial; font-size:12px; font-weight:bold; text-decoration:underline; color:Black;"> ????? ?????? </span>                
        </NodeTemplate>
        <DataBindings>
            <telerik:RadTreeNodeBinding Expanded="True" />
        </DataBindings>
    </telerik:RadTreeView>

 

 

 

 

 

 

 

 

 

roy
Top achievements
Rank 1
 asked on 16 Feb 2011
2 answers
144 views
I have a CommandItemTemplate contain RadToolBar which also contain RadComboBox, what i need to do here is to dynamically set value for the RadComboBox when page is loaded and in button click event. This is the code I have in Page_Load/Button_Click event:  
GridItem commandItem = RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0];
                RadToolBar radtoolbar = (RadToolBar)commandItem.FindControl("RadToolBar1");
                RadToolBarItem comboitem = radtoolbar.FindItemByText("RadToolBarButton1");
                RadComboBox rcb = (RadComboBox)comboitem.FindControl("RadComboBox1");
 I kept getting "Index was outside the bounds of the array" but I have only one Item (RadToolBar) in CommandItemTemplate. I saw samples that do it in ItemCreate event, but I need my control to interact with button click, how can I do it?

Thanks  in advance!

Shannon
Shannnon
Top achievements
Rank 1
 answered on 16 Feb 2011
0 answers
74 views
Hi guys,
I have a tabstrip and a multipage and want to be able to have individual tabs clicked which show their individual relevant pages. Then, if you click on a single page tab, it shows only that one page.But when I go to design view it shows me all pages no matter what tab I am clicking.

<

 

div id="TabForms">

 

 

<telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" SelectedIndex="0" EnableEmbeddedSkins="False">

 

 

<Tabs>

 

 

<telerik:RadTab Text="Header Info">

 

 

</telerik:RadTab>

 

 

<telerik:RadTab Text="Section - 1" >

 

 

</telerik:RadTab>

 

 

<telerik:RadTab Text="Section - 2 &amp; 3" >

 

 

</telerik:RadTab>

 

 

 

<telerik:RadTab Text="Section - 4">

 

 

</telerik:RadTab>

 

 

 

</Tabs>

 

 

</telerik:RadTabStrip>

 

 

<telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" >

 

 

<telerik:RadPageView ID="RadPageView1" runat="server">

 

Thanks so much for help.

Vasya Ivanov
Top achievements
Rank 1
 asked on 16 Feb 2011
2 answers
202 views
I have an inline edit form and everything is working great except I need to have it with more than one column ( like in the demo ). I have attached a screen shot of what I want to do. I have tried setting ColumnNumber to 2 but that has not worked.

Thanks!
Clark
Top achievements
Rank 1
 answered on 16 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?