Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
142 views
Hello,
I use toolbar as a control inside CommandItemTemplate for RadGrid. One of buttons has CommandName="DeleteSelected". I can select rows only from clientside. How do I pass row IDs to CommandArgument from clientside?
That's how I use the button:
<telerik:RadToolBarButton runat="server" ImageUrl="~/images/btnDel.png" Value="delete"
            CommandName="DeleteSelected" Enabled="false"/>


function ToolbarClientButtonClicking(sender, args) {
            if (args.get_item().get_value() == "delete") {               
                 args.set_cancel(!confirm("Delete selected rows?"));
                return;
            }
Is there a way to add custom arguments to command from clientside before postback and ItemCommand event?
Thank you
Kevin
Top achievements
Rank 2
 answered on 21 Oct 2011
1 answer
342 views
Hi, when I click on the cancel button on the javascript confirm dialog, it does do a postback. 

The problem is that the file is just a (.cs), so I can't use the "return args.set_cancel(true);" argument in de aspx file.
.
Creating Remove button and javascript confirm:
// Remove
rtb = new RadToolBarButton();
rtb.CommandName = "Remove";
rtb.Text = "";
rtb.ImageUrl = "~/Images/actiontoolbar/actiontoolbar_remove.png";
rtb.DisabledImageUrl = "~/Images/actiontoolbar/actiontoolbar_remove_grayed.png";
rtb.CausesValidation = false;
rtb.Attributes.Add("onclick", "javascript: if (!confirmDelete()) return false;");
radtoolbar.Items.Add(rtb);

Creating message:
/// <summary>
/// Shows a conformation dialog when deleting.  On by default.
/// </summary>
[DefaultValue(true)]
public bool ConfirmDelete
{
    get
    {
        return (bool)(this.ViewState["ConfirmDelete"] ?? true);
    }
    set
    {
        this.ViewState["ConfirmDelete"] = value;
    }
}
 
/// <summary>
/// Shows this message in a conformation dialog when deleting ans ConfirmDelete is on.  On by default.
/// </summary>
[DefaultValue("Are you sure you want to delete this record?")]
public string ConfirmDeleteMessage
{
    get
    {
        return (string)(this.ViewState["ConfirmDeleteMessage"] ?? "Are you sure you want to delete this record?");
    }
    set
    {
        this.ViewState["ConfirmDeleteMessage"] = value;
    }
}
 
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    RadScriptManager.RegisterClientScriptBlock(Page, GetType(), "confirmdelete", @"function confirmDelete(){return confirm('" + ConfirmDeleteMessage + "');}",true);
}

I hope somebody can help me.

Thanks.
Kevin
Top achievements
Rank 2
 answered on 21 Oct 2011
17 answers
354 views
Hello guys,

I have a Web Application that was originally created on SharePoint 2007 and on several pages we are using the RadEditor for MOSS webpart. Now we're migrating that Web Application to SharePoint 2010. I've installed the RadEditor for Sharepoint before migrating the content but when I migrate the content I get the next error on the pages that are using RadEditor for MOSS:

"Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type could not be found or it is not registered as safe."

I know that the problem could be that the webpart changes its name and that now I've to change ALL the pages that are using the SP 2007 webpart to the new 2010 one.

I would like to know if there is any quick way to do the migration of webparts because we have several pages with that error and It's going to take a while in order to have all of them fixed.

Thanks in advance.
IT Department
Top achievements
Rank 1
 answered on 21 Oct 2011
1 answer
121 views
Hello everybody!
I have a problem when I use radmenu. I need load menu form a SQL database. I done, but I can't use multi-column (Error in IE9 and Firefox ) and when I use scrolling : my radmenu is 2 rows (Error in IE9 but not in FireFox).
Have you any ideas! Thank you very much!
My code is upload in link:
    http://www.mediafire.com/?8d1g24e6i5ee1tz
Or:
Code behind:
string connectionString = @"Server=PHAMDUCANH-PC\SQLEXPRESS; database=TestDB;Integrated Security = True";
        string command = "SELECT * FROM Menu";
        SqlDataAdapter da = new SqlDataAdapter();
        DataSet ds = new DataSet();
         
 
        protected void Page_Load(object sender, EventArgs e)
        {   
 
            if (!IsPostBack)
            {               
                SqlConnection conn = new SqlConnection(connectionString);
                conn.Open();
                SqlCommand cmd = new SqlCommand(command, conn);
                da.SelectCommand = cmd;
                da.Fill(ds);
                ds.AcceptChanges();
                DataSet dsMenu = new DataSet();
                dsMenu.Tables.Add(ds.Tables[0].Copy());
                if (dsMenu != null && dsMenu.Tables.Count > 0 && dsMenu.Tables[0].Rows.Count > 0)
                {                  
                    mnuMenu.Items.Clear();
                    var drGoc = dsMenu.Tables[0].Select("ParentMenuID = -1");
                    if (drGoc != null && drGoc.Length > 0)
                    {
                        foreach (DataRow dr in drGoc)
                        {
                            RadMenuItem item = new RadMenuItem();
                            item.Value = dr["MenuID"].ToString().Trim();
                            item.Text = dr["Header"].ToString().Trim();
                            CreateTree(item, dsMenu);
                            mnuMenu.Items.Add(item);
                        }
                    }
                }
            }
        }
 
        public void CreateTree(RadMenuItem node, DataSet ds)
        {
            try
            {
                node.Items.Clear();
                var p = ds.Tables[0].Select("ParentMenuID=" + node.Value);
                if (p != null && p.Length > 0)
                {
                    foreach (DataRow dr in p)
                    {
                        RadMenuItem item = new RadMenuItem();
                        item.Value = dr["MenuID"].ToString().Trim();
                        item.Text = dr["Header"].ToString().Trim();
                        if (dr["Path"].ToString().Trim().Length > 0)
                        {
                            
                            item.NavigateUrl = "~/Default.aspx?Menu=" + dr["Path"].ToString().Trim();
                        }
                        node.Items.Add(item);
                        CreateTree(item, ds);
                    }
                }
            }
            catch
            {
            }
        }
UI:

<telerik:RadMenu runat="server" ID="mnuMenu" EnableRootItemScroll="true" Width="400px"
                           EnableRoundedCorners="true" EnableShadows="true" 
                           Skin="WebBlue">
           <DefaultGroupSettings Height="100px" RepeatColumns="2"/>                     
                 <Items>
                     <telerik:RadMenuItem Text = "New..." >
                         <GroupSettings Height="100px" RepeatColumns="2"></GroupSettings>
                         <Items>                                   
                                <telerik:RadMenuItem Text="File"></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Folder"></telerik:RadMenuItem>
                         </Items>
                     </telerik:RadMenuItem>
                     <telerik:RadMenuItem Text="Open">
                          <GroupSettings Height="100px"></GroupSettings>
                          <Items>
                               <telerik:RadMenuItem Text="File"></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Folder"></telerik:RadMenuItem>
                          </Items>
                      </telerik:RadMenuItem>
                      <telerik:RadMenuItem Text="Close">
                          <GroupSettings Height="100px"></GroupSettings>
                          <Items>
                                <telerik:RadMenuItem Text="File"></telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Folder"></telerik:RadMenuItem>
                          </Items>
                          </telerik:RadMenuItem>
                      <telerik:RadMenuItem Text="Save" >
                            <GroupSettings Height="100px"></GroupSettings>
                                <Items>
                                   <telerik:RadMenuItem Text="File"></telerik:RadMenuItem>
                                   <telerik:RadMenuItem Text="Folder"></telerik:RadMenuItem>
                               </Items>
                           </telerik:RadMenuItem>
                           <telerik:RadMenuItem Text="Save as ...">
                               <GroupSettings Height="100px"></GroupSettings>
                                <Items>
                                   <telerik:RadMenuItem Text="File"></telerik:RadMenuItem>
                                   <telerik:RadMenuItem Text="Folder"></telerik:RadMenuItem>
                               </Items>
                           </telerik:RadMenuItem>                          
                       </Items>                   
                   </telerik:RadMenu>
Kate
Telerik team
 answered on 21 Oct 2011
3 answers
274 views
Hi ALL,

         Let me tell you my current flow and what i want to do.

         I have one parent page with link as "Add New" and RadGrid, when user click on link radwindow will get open.

        User will fill up the details and click on save button, record will get save into DB and want to refresh the RadGrid on parent page.

        I have used RadAjaxManager on parent page to call radajaxrequest to refresh the grid.and update that particular grid only,

        But on same page i have to maintain history.back functionality on cancel button, whenever ajaxrequest get fire page will get postback.so when user click on cancel button user will stay on same page rather than previous page.

       Can you please help me out to refresh the parent page grid without any postback, so i can mange window.history on cancel button.
 

      
Tsvetina
Telerik team
 answered on 21 Oct 2011
3 answers
210 views
hey

I've a little problem with the js function $find...
The Menu used in the UserControl XY
I try to get the client object of the Menu with $find("<%=XYObject.InnerMenu.ClientId %>") but it returns null
so I've tried the function $get which worked...  the readyState is also 'complete'...
When I add the Menu directly without the UserControl it's working....

Greetings
Kate
Telerik team
 answered on 21 Oct 2011
1 answer
66 views
I am using the trial version of RAD Editor for sharepoint 2010. Although i am able to see the tools of the editor, the issue comes when i save the page, only plain HTML is rendered. Like if i add an image through the rad editor on saving the page i get the following html on my page:

<img width="800" height="375" alt="" style="width: 800px; height: 217px;" 
src="/sites/testJTI/Documents/Image1.jpg" />

Can anyone guide me if i am missing something in the settings or a particular config file entry.
Rumen
Telerik team
 answered on 21 Oct 2011
1 answer
109 views
Hi,

I've been using the Telerik toolkit with great ease since 2009 with that year's release. We have recently had to upgrade to the new toolkit and the manager (Images, documents and flash are the main ones I use.) stopped working. I would usually set the manager's folders from code, and I use this in a centralized admin for about several websites. The code looks like this:
             
Dim sUpldPath As String = "~/Admin/Uploads/" & sWebsiteName & "/"

Dim sImg() As String = {sUpldPath & "images"}
Dim sFls() As String = {sUpldPath & "flash"}
Dim sDoc() As String = {sUpldPath & "documents"}

RadEditor1.ImageManager.DeletePaths = sImg
RadEditor1.ImageManager.ViewPaths = sImg
RadEditor1.ImageManager.UploadPaths = sImg

RadEditor1.FlashManager.DeletePaths = sFls
RadEditor1.FlashManager.ViewPaths = sFls
RadEditor1.FlashManager.UploadPaths = sFls

RadEditor1.DocumentManager.DeletePaths = sDoc
RadEditor1.DocumentManager.ViewPaths = sDoc
RadEditor1.DocumentManager.UploadPaths = sDoc

For the most part this works, in the new and old control kit, but when the sWebsite name contains a space e.g. sWebsiteName = "Website ABC" then it doesn't work in the new control kit. Any suggestions as to how to fix that?
Dobromir
Telerik team
 answered on 21 Oct 2011
2 answers
62 views

I updated my controls from 2008 and for some reason the pager now displays on 5 lines.  Any idea why this might be happening?  I have posted the code below.

Thanks

<telerik:RadGrid ID="rgSalesOrder" DataSourceID="dsSalesOrderList" ShowHeader="true"
                    Width="676px" Height="185" AutoGenerateColumns="false" GridLines="None" AllowPaging="True"
                    PageSize="30" runat="server" OnSelectedIndexChanged="rgSalesOrder_SelectedIndexChanged"
                    OnItemDataBound="rgSalesOrder_ItemDataBound" OnSortCommand="rgSalesOrder_SortCommand" onpageindexchanged="rgSalesOrder_PageIndexChanged"
                    Skin="" EnableEmbeddedSkins="False" ImagesPath="~\Images\Grid\" CssClass="grid"
                    AllowSorting="true">
                    <PagerStyle Position="Bottom" AlwaysVisible="True"  />
                    <MasterTableView AllowPaging="true" DataKeyNames="Id" AllowSorting="true">
                        <Columns>
                            <telerik:GridTemplateColumn HeaderText="Customer" ItemStyle-Width="250px" HeaderStyle-Width="250px" SortExpression="Company">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lbtnCompany" runat="server" Text='<%#Bind("Company") %>' OnClick="lbtnCompany_Click"></asp:LinkButton>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:LinkButton ID="lbtnCompany" runat="server" Text='<%#Bind("Company") %>' OnClick="lbtnCompany_Click"></asp:LinkButton>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                              
                            <telerik:GridBoundColumn HeaderText="User" DataField="CreatedBy" HeaderStyle-Width="50px" ItemStyle-Width="50px">
                            </telerik:GridBoundColumn>
                              
                            <telerik:GridButtonColumn ButtonType="LinkButton" HeaderText="Quote#" CommandName="Select"
                                DataTextField="Id" SortExpression="Id" HeaderStyle-Width="65px" ItemStyle-Width="65px">
                            </telerik:GridButtonColumn>
                            <telerik:GridBoundColumn HeaderText="Date" DataField="CreatedOn" DataFormatString="{0:MM/dd/yyyy}"
                                HeaderStyle-Width="85px" ItemStyle-Width="85px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Status" DataField="OrderStatus" HeaderStyle-Width="70px"
                                ItemStyle-Width="70px">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn HeaderText="Value" DataField="QuoteValue" HeaderStyle-Width="100px"
                                ItemStyle-Width="100px" DataFormatString="{0:c}">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="ACTION" SortExpression="Status" HeaderStyle-Width="155px"
                                ItemStyle-Width="155px" HeaderStyle-HorizontalAlign="Center" Visible="false">
                                <ItemTemplate>
                                    <table id="tblStatus" border="0px" cellpadding="0px" cellspacing="0px" width="155px">
                                        <tr>
                                            <td style="text-align: center">
                                                <asp:Label ID="lblCustomerID" runat="server" Visible="false" Text='<%# Bind("CustomerId") %>'></asp:Label>
                                                <asp:Label ID="lblStatusID" runat="server" Visible="false" Text='<%# Bind("Status") %>'></asp:Label>
                                                <asp:Label ID="lblStatus" runat="server" Visible="false" Text='<%# Bind("Status") %>'></asp:Label>
                                                <asp:Label ID="lblRowStyle" runat="server" Visible="false" Text='<%# Bind("RowStyle") %>'></asp:Label>
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="" ItemStyle-HorizontalAlign="Right">
                                <ItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkSelect" />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:CheckBox runat="server" ID="chkSelect" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        <%--<ItemStyle CssClass="gridstyle"></ItemStyle>--%>
                       <HeaderStyle CssClass="gridheaderstyle"></HeaderStyle>
                    </MasterTableView
                        <SelectedItemStyle BackColor="#FFFFCC" />
                                <ActiveItemStyle BackColor="#FFFFCC" />
                    <ClientSettings>
                        <Scrolling AllowScroll="True" UseStaticHeaders="true" ScrollHeight="141"  />
                          
                        <%--<ClientEvents OnGridCreated= "SetHeight"  />--%>
                    </ClientSettings>
                </telerik:RadGrid>

 

Paul
Top achievements
Rank 1
 answered on 21 Oct 2011
1 answer
229 views
I thought I'd share this solution here to save anyone else the hours of tearing hair out that I've had.

I had a master page and user controls using RadAjaxProxyManagers and the RadAjaxLoadingPanel was displaying for some buttons and not others. I played around with the setup of the page and narrowed it down to the buttons that had causesvalidation="false" were the ones that worked as expected.

This however was a red herring, as I eventually discovered the problem was caused by having ClientIDMode set to Static on the radbuttons! Why does setting ClientIDMode="Static" break showing the loading panel, but everything else functions fine?

<asp:Content ID="bodyPlaceholder" ContentPlaceHolderID="BodyPlaceHolder" runat="server">
 
  <div id="wrapper" runat="server">
 
    <!-- various grids etc -->
 
    <div>
       <div class="left">
         <telerik:RadButton runat="server" ID="addButton" ClientIDMode="Static" Text="Add" OnClick="Add" />
       </div>
       <div class="right">
         <telerik:RadButton runat="server" ID="okButton" ClientIDMode="Static" Text="OK" OnClick="Ok" />
         <telerik:RadButton runat="server" ID="cancelButton" ClientIDMode="Static" Text="Cancel" OnClick="Cancel" CausesValidation="false" />
          </div>
          <div class="clear">
        </div>
      </div>
  </div>
 
  <telerik:RadAjaxManagerProxy runat="server" ID="ajaxProxy" ClientIDMode="Static">
    <AjaxSettings>
      <telerik:AjaxSetting AjaxControlID="ajaxProxy">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="wrapper" LoadingPanelID="loadingPanel" />
        </UpdatedControls>
      </telerik:AjaxSetting>
      <telerik:AjaxSetting AjaxControlID="wrapper">
        <UpdatedControls>
          <telerik:AjaxUpdatedControl ControlID="wrapper" LoadingPanelID="loadingPanel" />
        </UpdatedControls>
      </telerik:AjaxSetting>
    </AjaxSettings>
  </telerik:RadAjaxManagerProxy>
 
  <telerik:RadAjaxLoadingPanel runat="server" ID="loadingPanel" />
 
</asp:Content>


Tsvetina
Telerik team
 answered on 21 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?