Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
224 views
I want to change a column header text in client-side (javascript + jquery). The column header support reorder.

I have this code:

$(grid.get_masterTableView().getColumnByUniqueName('ColumnUniqueName').get_element()).text('New header text')

I get the header text to be changed but I lose the link to reorder the column. Is there any other way to get the header text changed?

Thanks


Dariusz
Top achievements
Rank 1
 answered on 10 Nov 2011
2 answers
62 views

Dear Telerik,

    I use a grid,when I add new record,I want fire a function of my js script.but I use the radajax so I use  ClientScript.RegisterStartupScript  function is unuseful...
    my code:
    

function showEdit(customer, contact) {
    window.radopen("ContactEdit.aspx?cus=" + customer + "&contact=" + contact, "EditContact");
    return false;
}

protected void RadGridList_InsertCommand(object sender, GridCommandEventArgs e)
{
    Parents parents = new Parents();
    parents.Customer_No = ((TextBox)e.Item.FindControl("txtParentsCode")).Text.Trim();
    parents.English_Name = ((TextBox)e.Item.FindControl("txtEnName")).Text.Trim();
    parents.Join_Date = DateTime.Parse(((RadDatePicker)e.Item.FindControl("rdpJoinDate")).SelectedDate.ToString());
    parents.Salesman_Code = ((RadComboBox)e.Item.FindControl("rcbSalesman")).SelectedValue.Trim();
    parents.BR_No = ((TextBox)e.Item.FindControl("txtBRNo")).Text.Trim();
    parents.CR_No = ((TextBox)e.Item.FindControl("txtCRNo")).Text.Trim();
    parents.Remarks = ((TextBox)e.Item.FindControl("txtRemarks")).Text.Trim();
    parents.Parent_Customer_No = ((RadComboBox)e.Item.FindControl("rcbParent")).SelectedValue.Trim();
    parents.Alternative_Name = ((TextBox)e.Item.FindControl("txtAlternative")).Text.Trim();
    parents.Music_Service_Type = ((TextBox)e.Item.FindControl("txtMusSerType")).Text.Trim();
    parents.Next_Contact_Datetime = DateTime.Parse(((RadDatePicker)e.Item.FindControl("rdpNextConDate")).SelectedDate.ToString());
    try
    {
        new BLL.ParentsBLL().Add(parents);
        BindData();
        ClientScript.RegisterStartupScript(GetType(), "message", "<script language='javascript'>showEdit('0004', '')</script>");
    }
    catch (Exception)
    {
        throw;
    }
}
Y
Top achievements
Rank 1
 answered on 10 Nov 2011
4 answers
223 views
I have a dropdownlist in EditItemTemplate / insertItemTEmplate and in the codebehind file I am trying to bind it to a datasource.
could you please suggest how to bind it to a data source and in which event i should do it in codebehind file?

here is my radtreelist :


<telerik:TreeListTemplateColumn DataField="WorkShopType" UniqueName="WorkShopType" HeaderText="WorkShopType" >
                   
<ItemTemplate>
 <%# Eval("WorkShopType")%></ItemTemplate>
            <EditItemTemplate>
         <asp:DropDownList ID="ddlWorkShopTypeEdit" runat="server" />
                         </EditItemTemplate>
                         <InsertItemTemplate>
<asp:DropDownList ID="ddlWorkShopTypeInsert" runat="server"/>
</asp:RequiredFieldValidator></InsertItemTemplate></telerik:TreeListTemplateColumn>
Kushal
Top achievements
Rank 1
 answered on 10 Nov 2011
1 answer
220 views
I have a RadGrid with all rows set to be editable (inline) in PreRender. I'm setting a background color (BackColor) on every other GridEditableItem in this step, because there is no alternate style for editable rows.

I've got a heavy border at the bottom of each row - as well as a background image (according to FireBug it's coming from an axd resource).

The "Selected" row style also is hidden because of this default background image.

I've spent several hours trying to get rid of the border (1px from the inline style and 1px from the background image), and have had no luck.  

I can disable the border in Firebug and/or IE's developer tools, on the fly, and eliminate the border, allow the Selected Row style to function, but I can't seem to do it in my app.

Any assistance for what should be a very simple task would be greatly appreciated!

In my default css:

div.RadGrid_Default .rgEditRow
{
    background-image:none !important;
    border:none;
}


PreRender in code-behind:

protected void Page_PreRender(object sender, EventArgs e)
       {
           bool alternate = false;
            
           foreach (GridItem item in grid.MasterTableView.Items)
           {
               if (item is GridEditableItem)
               {
                   GridEditableItem editableItem = item as GridDataItem;
                   editableItem.Edit = true;
                   if (alternate)
                   {
                       item.BackColor = System.Drawing.ColorTranslator.FromHtml("#efefef");
                   }
                   alternate = !alternate;
               }
           }
       }

Jayesh Goyani
Top achievements
Rank 2
 answered on 10 Nov 2011
1 answer
64 views

When I try to filter an item in a grid which has virtual scrolling enabled on client side, it does not bring up anything. 

I am trying to get an item which has an id 100. I am scrolling through the pages in a grid virtually, but when I search for an item it brings up a blank page.

Please advice.

Thanks,
Divya
Princy
Top achievements
Rank 2
 answered on 10 Nov 2011
4 answers
312 views
I am using the current version of the RadGrid control for ASP.NET/AJAX and am following the edit template example using a SQLDataSource to handle Select/Insert/Update/Delete. I have the example working and would like to be able to have a multi-selectable listbox control, either the stabndard control or Rad control, that will populate the selected values into a single column within the RadGrid as a comma or semicolan delimited value. I would also like the item(s) of the list box to be selected based on the delimited value during edit events on existing records. Based on what I have coded, only the first selected item is inserted/updated into the corresponding RadGrid column and database. Do I need to add on_Updating and on_Inserting events in the code behind to handle this and how do I go about passing the correct value to the SQLDataSource?

The listbox contained within the edit template is as follows:

 

 

<asp:ListBox ID="lbLights" runat="server" SelectionMode="Multiple" SelectedValue='<%# Bind("Lights") %>'

 

 

 

DataSource='<%# (new string[] { "HIRL", "MIRL", "LIRL", "Centerline Lights", "Pilot Controlled", "Non-Standard", "None" }) %>' TabIndex="8" AppendDataBoundItems="True">

 

 

 

<asp:ListItem Selected="True" Text="Select" Value=""></asp:ListItem>

 

 

 

</asp:ListBox>

 


Thanks,

Aaron
Velmurugan
Top achievements
Rank 1
 answered on 10 Nov 2011
1 answer
57 views
I have a radbutton and a textbox in edititemtemplate.How can i make the textbox disabled when user clicks the radbutton?
Princy
Top achievements
Rank 2
 answered on 10 Nov 2011
1 answer
95 views
Hi. I can create and delete folders, upload and delete files. But the refreshing logo with greyed out background won't go away.

My code is below. For an image of the issue please look at http://stackoverflow.com/questions/7927274/telerik-upload-manager-folder-creates-and-deletes-but-refresh-images-stays

telerikupload.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="telerikupload.aspx.cs" Inherits="plle_telerikupload" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
 
<head runat="server">
    <title></title>
</head>
<body>
<form runat="server">
     <asp:ScriptManager ID="ScriptManager1" runat="server" />
     
            <telerik:dialogopener runat="server" id="DialogOpener1"></telerik:dialogopener>            
            <asp:Button runat="server" ID="DocumentManagerButton" Text="doc"
                        Visible="true" />            
        </asp:Panel>
        <asp:Label ID="Info" SkinID="Info" runat="server" />
    </div>
    </form>
</body>
 
</html>

telerikupload.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI.Editor.DialogControls;
using Telerik.Web.UI;
 
public partial class plle_telerikupload : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        FileManagerDialogParameters documentManagerParameters = new FileManagerDialogParameters();
        documentManagerParameters.ViewPaths = new string[] { "~/" };
        documentManagerParameters.UploadPaths = new string[] { "~/" };
        documentManagerParameters.DeletePaths = new string[] { "~/" };
        
        var dialog = "~/dialogs/default/";
         
 
        documentManagerParameters["ExternalDialogsPath"] = dialog;
 
        DialogDefinition documentManager = new DialogDefinition(typeof(DocumentManagerDialog), documentManagerParameters)
        {
            ClientCallbackFunction = "DocumentManagerFunction",
            Width = Unit.Pixel(694),
            Height = Unit.Pixel(440)
        };
 
        DialogOpener1.DialogDefinitions.Add("DocumentManager", documentManager);
 
        DocumentManagerButton.OnClientClick = string.Format("$find('{0}').open('DocumentManager');return false;", this.DialogOpener1.ClientID);
    }
}
Rumen
Telerik team
 answered on 10 Nov 2011
1 answer
51 views
My radbutton looks pressed in IE.Is there any work around for this?
Rumen
Telerik team
 answered on 10 Nov 2011
1 answer
43 views
Hi

I have been trying to copy a list from Word that is not formatted with the style normal. When i paste it into RadEditor i get strange formatting on my list. For example: I can make a paragraph style in Word called ListParapraph. I then make a new listformat that uses the ListParagraph style for the text. When i try to copy that list to RadEditor 2008 Q2 it makes the list like stairs and it adds a lot of empty space below the list.
Here is the HTML-code that i get.
<p style="margin: 0cm 0cm 10pt 36pt" class="TestParagraph2"><span style="font-family: symbol"><span style="font-size: 24px">·</span><span style="font: 7pt 'times new roman'">        </span><span style="font-size: 24px">Sdfsdfsdfs</span>
<p style="margin: 0cm 0cm 10pt 36pt" class="TestParagraph2"><span style="font-family: symbol"><span style="font-size: 24px">·</span><span style="font: 7pt 'times new roman'">        </span><span style="font-size: 24px">Dfsdfsdfs</span>
<p style="margin: 0cm 0cm 10pt 36pt" class="TestParagraph2"><span style="font-family: symbol"><span style="font-size: 24px">·</span><span style="font: 7pt 'times new roman'">        </span><span style="font-size: 24px">Dfsdfsdfs</span>
<p style="margin: 0cm 0cm 10pt 36pt" class="TestParagraph2"><span style="font-family: symbol"><span style="font-size: 24px">·</span><span style="font: 7pt 'times new roman'">        </span><span style="font-size: 24px">Fsdfsdf</span>
<p style="margin: 0cm 0cm 10pt 36pt" class="TestParagraph2"><span style="font-family: symbol"><span style="font-size: 24px">·</span><span style="font: 7pt 'times new roman'">        </span><span style="font-size: 24px">sdfsdfsdfsdfs</span></span></p>
</span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</span></p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>

Its not closing the <p> tags after each line so the list becomes very strange (like stairs). I noticed that the behavior is changed in newer versions of RadEditor but is that the only way to fix the problem?


Rumen
Telerik team
 answered on 10 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?