Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
173 views
Hi,

When using a standard button I am noticing that a lot of the time the right side of the button appears before the page finishes loading and well before the rest of the button finishes loading.  I'm noticing this on IE8 and haven't tested on any other browsers.  

Let me know if you want a screenshot...

Cheers,
Jon
Bozhidar
Telerik team
 answered on 19 Nov 2010
1 answer
103 views
Hi,

I'm wanting to use some context based code on a RadDock drag handle but when I hookup my javascript to the right click/oncontextmenu that works great but the dock fires off the OnClientDockPositionChanged event. Can anyone help me in removing the handler from the right mouse button/oncontextmenu so the dock does not fire off the extra events.

Thanks.
Pero
Telerik team
 answered on 19 Nov 2010
2 answers
81 views
Hi,
I'm using the RAD Editor as content management tool in ASP.NET. Now I want to remove some unwanted formatting comes from MSWord when copying a Table created in Word. Is there any way to remove the specific attributes or retaining only width or height attributes only. if you have provide some samples.

Regards,
Elangovan P
Elangovan
Top achievements
Rank 1
 answered on 19 Nov 2010
5 answers
518 views
I've tried "http://demos.telerik.com/aspnet-ajax/controls/examples/integration/aspajaxchartapplication/defaultcs.aspx?product=chart",
but I have noticed a blink/flickers. how to eliminate the blink
/flickers.
Phil
Top achievements
Rank 2
 answered on 19 Nov 2010
2 answers
239 views
Hi All,
I am having trouble accessing a control in my HeaderTemplate on the client side (javascript). The PanelBar looks like : 
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" ExpandMode="FullExpandedItem"
        OnItemClick="RadPanelBar1_ItemClick" Width="100%" OnClientItemClicking="OnExpandoClick"
        Height="100%">
        <Items>
            <telerik:RadPanelItem runat="server" Text="Element" Selected="True" 
                Expanded="True">
                <Items>
                    <telerik:RadPanelItem runat="server" Value="Element">
                        <ItemTemplate>
                            <telerik:RadGrid ...</telerik:RadGrid>
                        </ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
                <HeaderTemplate>
                <div style="margin-left: 5px">
                    <asp:Label ID="ElementDescriptor" runat="server" Text="Element"></asp:Label>
                </div>
                </HeaderTemplate>
            </telerik:RadPanelItem>
<telerik:RadPanelItem runat="server" Text="Category" BackColor="#8080FF">
                <Items>
                    <telerik:RadPanelItem runat="server" Value="Category">
                        <ItemTemplate>
...
</ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
                <HeaderTemplate>
                <div style="margin-left: 5px">
                    <asp:Label ID="CategoryDescriptor" runat="server" Text="Category"></asp:Label>
                </div>
                </HeaderTemplate>
            </telerik:RadPanelItem>
            <telerik:RadPanelItem runat="server" Text="Criteria" BackColor="#00C000">
                <Items>
                    <telerik:RadPanelItem runat="server" Value="Criteria">
                        <ItemTemplate>
...
</ItemTemplate>
                    </telerik:RadPanelItem>
                </Items>
                <HeaderTemplate>
                <div style="margin-left: 5px">
                    <asp:Label ID="CriteriaDescriptor" runat="server" Text="Criteria"></asp:Label>
                </div>
                </HeaderTemplate>
            </telerik:RadPanelItem>
        </Items>
        <ExpandAnimation Duration="1000" />
    </telerik:RadPanelBar>
Pretty much, the HeaderTemplate is used to remove the "Expand" image on the right of the default.
What I can't work out is how to access it to change the labels text. The following script is used on the OnClientItemClicking event for the PanelBar :
function OnExpandoClick(sender, eventArgs) {
    var panelBar = $find("<%= RadPanelBar1.ClientID %>");
    var currentItem = panelBar.get_selectedItem();
    var item = eventArgs.get_item();
    // Try 1
    //  var thisItem = panelBar.findItemByText('Category');
    //  thisItem.findControl('CategoryDescriptor').text = 'Category222';
    // Try 2
        var lbl = $find('<%= RadPanelBar1.FindItemByText("Category").Header.FindControl("CategoryDescriptor").ClientID %>');
        lbl.Text = 'Category222';
          
    } else {
        eventArgs.set_cancel(true);
    }
}
As you can see, I have tried 2 different ways, but to no avail.
Any help with this is greatly appreciated.
Steele.



Steele
Top achievements
Rank 1
 answered on 19 Nov 2010
2 answers
145 views
Hello!
I am using version 2010.1.519.35, and get a problem, in GridDateTimeColumn, i set PickerType="TimePicker", this aspx code:

<tlk:GridDateTimeColumn PickerType="TimePicker" DataFormatString="{0: HH:mm}" DataField="StartTime" HeaderText="Start time" UniqueName="StartTime">                          
      <HeaderStyle Width="110px" />
      <ItemStyle Wrap="true" />
</tlk:GridDateTimeColumn>

and code behind:

protected void _grid_ItemDataBound(object sender, GridItemEventArgs e)
{
  if (e.Item is GridEditableItem && e.Item.IsInEditMode)
        {
            ((RadTimePicker)item["StartTime"].Controls[0]).TimeView.TimeFormat = "HH:mm";
            ((RadTimePicker)item["StartTime"].Controls[0]).TimeView.Columns = 2;
 
            ((RadTimePicker)item["StartTime"].Controls[0]).DateInput.DateFormat = "HH:mm";
            ((RadTimePicker)item["StartTime"].Controls[0]).DateInput.DisplayDateFormat = "HH:mm";
        }
}

DateInput's properties works fine, but TimeView does not. In time popup, timeformat's still "t", not "HH:mm", and columns number is three (3). Please help me solve this proplem.
(Sorry for my bad english)
Thanks so much!
Thai Thuong
Top achievements
Rank 1
 answered on 19 Nov 2010
3 answers
106 views
Hello,

While exporting grid data, the data dispalyed in grid such as $8,000.00 is exported as just 8000 instead of $8,000.

Is there a way to preserve the format while exporting to excel?

Thank you

Regards
Raj
Daniel
Telerik team
 answered on 18 Nov 2010
2 answers
148 views

Hello,

I have a page with a RadWindow open. THe RadWindow page executes response.Redirect. For some reason, when the radwindow redirects, all scripts are failing to load: Sys and JQuery are undefined. Why would that be?

Thanks.

Brian Mains
Top achievements
Rank 1
 answered on 18 Nov 2010
2 answers
264 views

Hi, I'm using RadAsyncUpload to let the user upload a file (one row only). Once a file uploaded if I check the "remove" cross button and post back the page, the file is sent to the server because it was not removed from the uploaded files.

The C# call
if (RadAsyncUpload1.UploadedFiles.Count == 0 ) is false.

I tried to add a javascript code to clear up but it didn't work.
What should I do ?
- is there a way server side to select only the file which is shown in the RadAsyncUpload Textbox?
- or is there a way to clear that uploaded file list if I click on the remove button?

Thanks.

Hervé
Top achievements
Rank 1
 answered on 18 Nov 2010
1 answer
79 views
Hi,

I have a dropdown combobox which have 3 table listed. Each different selection will cause a selectedindexchanged event handler which reload the grid. There's 2 column declared on the front end: GridEditCommandColumn(edit) and GridButtonColumn(delete). Each time the grid is loaded or reloaded, a random number of boundcolumn are added to the grid based on the number of column from the selected table(from the combobox). All works fine except the edit and add row function. When I click add a new row, a textbox is added(in line) on the grid, for each column(except the edit and delete). After I enter value into the textbox, I can't seem to grab this value in the code behind.

Here's my code:
Private Sub LoadRadGrid(ByVal selectedTable As String, ByVal loadType As String)
        Dim ds As DataSet = New DataSet
  
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("SqlConn").ConnectionString
        Dim conn As SqlConnection = New SqlConnection(ConnString)
        Dim adapter As SqlDataAdapter = New SqlDataAdapter
  
        Dim sqlString As String = "SELECT ID, Iron, Name, Type FROM JOE_Coffee"
  
        If selectedTable = "JOE_Coffee" Then
            sqlString = "SELECT ID, Iron, Name, Type FROM JOE_Coffee"
        ElseIf selectedTable = "JOE_Cake" Then
            sqlString = "SELECT ID, Name FROM JOE_Cake"
        ElseIf selectedTable = "JOE_Tip" Then
            sqlString = "SELECT ID, Name FROM JOE_Tip"
        End If
  
        adapter.SelectCommand = New SqlCommand(sqlString, conn)
  
        Try
            adapter.Fill(ds, "Table1")
  
            For Each column As GridColumn In RadGrid1.MasterTableView.RenderColumns
                'If Not column.UniqueName = "EditCommandColumn" Then
  
                'End If
                If column.ColumnType = "GridBoundColumn" Then
                    Dim columnIndex As Integer = column.OrderIndex
                    RadGrid1.MasterTableView.Columns.Remove(column)
                End If
  
            Next
  
            For i As Integer = 0 To ds.Tables(0).Columns.Count - 1
                Dim boundColumn(i) As GridBoundColumn
                boundColumn(i) = New GridBoundColumn()
                boundColumn(i).HeaderText = ds.Tables(0).Columns(i).ColumnName
                boundColumn(i).DataField = ds.Tables(0).Columns(i).ColumnName
                boundColumn(i).UniqueName = ds.Tables(0).Columns(i).ColumnName
                boundColumn(i).IsBoundToFieldName(ds.Tables(0).Columns(i).ColumnName)
  
                RadGrid1.MasterTableView.Columns.Add(boundColumn(i))
                  
            Next
  
            If loadType = "PageLoad" Or loadType = "LoadAfterDelete" Or loadType = "SelectedIndexChangeLoad" Then
                RadGrid1.DataSource = ds
                RadGrid1.DataBind()
            ElseIf loadType = "LoadAfterInsert" Or loadType = "LoadAfterUpdate" Then
                'RadGrid1.MasterTableView.Columns.Clear()
                RadGrid1.DataSource = ds
                RadGrid1.Rebind()
            ElseIf loadType = "NeedDataSourceLoad" Then
                RadGrid1.DataSource = ds
                'Don't need to bind for "NeedDataSourceLoad"
            End If
  
            For Each column As GridColumn In RadGrid1.Columns
                If column.HeaderText = "ID" Then
                    column.Visible = False
                End If
            Next
        Catch ex As Exception
        End Try
End Sub
  
Protected Sub RadGrid1_CreateColumnEditor(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCreateColumnEditorEventArgs) Handles RadGrid1.CreateColumnEditor
        If (TypeOf e.Column Is GridBoundColumn) Then
            e.ColumnEditor = New GridTextBoxColumnEditor
        End If
End Sub
  
Protected Sub RadGrid1_InsertCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid1.InsertCommand
        selectedTable = rcbTableName.SelectedValue.ToString()
  
        Dim iron As String = ""
        Dim name As String = ""
        Dim type As String = ""
  
        Dim ConnString As String = ConfigurationManager.ConnectionStrings("NineFiveSqlConn").ConnectionString
        Dim conn As SqlConnection = New SqlConnection(ConnString)
  
        Dim cmd As New SqlCommand()
        cmd.Connection = conn
  
        Dim sqlString As String = "INSERT INTO JMOS_Satellite(Iron, Name, Type) VALUES(@Iron, @Name, @Type)"
  
        If selectedTable = "JMOS_Satellite" Then
            sqlString = "INSERT INTO JMOS_Satellite(Iron, Name, Type) VALUES(@Iron, @Name, @Type)"
        ElseIf selectedTable = "JMOS_UplinkBeam" Then
            sqlString = "INSERT INTO JMOS_UplinkBeam(Name) VALUES(@Name)"
        ElseIf selectedTable = "JMOS_UplinkChannel" Then
            sqlString = "INSERT INTO JMOS_UplinkChannel(Name) VALUES(@Name)"
        End If
  
        cmd.CommandType = CommandType.Text
        cmd.CommandText = sqlString
  
        '<<<Need value to set parameter for insert>>>                
                          
        cmd.Parameters.Add("@Iron", SqlDbType.VarChar)
        cmd.Parameters("@Iron").Value = iron
        cmd.Parameters.Add("@Name", SqlDbType.VarChar)
        cmd.Parameters("@Name").Value = name
        cmd.Parameters.Add("@Type", SqlDbType.VarChar)
        cmd.Parameters("@Type").Value = type
  
        Try
            If Not conn.State = ConnectionState.Open Then
                conn.Open()
                cmd.ExecuteNonQuery()
            End If
  
        Catch ex As Exception
            e.Canceled = True
        Finally
            If Not conn.State = ConnectionState.Closed Then
                conn.Close()
            End If
        End Try
  
        loadType = "LoadAfterInsert"
        LoadRadGrid(selectedTable, loadType)
End Sub

Here's the front end:
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
  
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PageOne.aspx.vb" Inherits="WebRadGridDynamic.PageOne" %>
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <div align="center">
        <br />
        <br />
        <br />
        <br />
        <telerik:RadComboBox ID="rcbTableName" runat="server" DataTextField="TableName" 
            DataValueField="ID" AutoPostBack="true" 
            OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" Skin="Black" Width="200px">
                <Items>
                    <telerik:RadComboBoxItem Value="JMOS_Satellite" Text="Satellite" Selected="true" />
                    <telerik:RadComboBoxItem Value="JMOS_UplinkBeam" Text="Uplink Beam" />
                    <telerik:RadComboBoxItem Value="JMOS_UplinkChannel" Text ="Uplink Channel" />
                </Items>
        </telerik:RadComboBox>
        <br />
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
        <br />
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
            </script>
        </telerik:RadCodeBlock>
        <br />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <br />
        <telerik:RadGrid ID="RadGrid1" runat="server" Width="500px" GridLines="None" PageSize="13" 
        AllowSorting="True" AllowPaging="True" ShowStatusBar="True" Skin="Black" Height="225px" AutoGenerateColumns="False" >
        <AlternatingItemStyle HorizontalAlign="Left" />
        <MasterTableView DataKeyNames="ID" AllowMultiColumnSorting="True" Width="100%"
        CommandItemDisplay="Top" EditMode="InPlace" >
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
            <Columns>
                <telerik:GridEditCommandColumn UpdateText="Update" UniqueName="EditCommandColumn"
                CancelText="Cancel" EditText="Edit">
                    <HeaderStyle />
                    <ItemStyle Width="20px" />
                </telerik:GridEditCommandColumn>
                <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" 
                CommandName="Delete" ConfirmTitle="Delete" ConfirmDialogType="Classic" ConfirmDialogHeight="60" ConfirmDialogWidth ="150" ConfirmText="Are you sure you want to delete row?" >
                    <HeaderStyle />
                    <ItemStyle Width="20px" />
                </telerik:GridButtonColumn>
                  
            </Columns>
            <EditFormSettings CaptionFormatString="Edit details ID {0}" CaptionDataField="ID">
                <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle>
                <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>
                <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>
            <EditColumn ButtonType="ImageButton" />
            </EditFormSettings>
        </MasterTableView>
        <ClientSettings AllowColumnHide="True">
            <ClientEvents OnRowDblClick="RowDblClick" />
            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        </ClientSettings>
        <EditItemStyle />
        <HeaderStyle HorizontalAlign="Center" />
        <SelectedItemStyle />
            <ItemStyle HorizontalAlign="Left" />
        </telerik:RadGrid>
        <br />
        <br />
    </div>
    <div >
    </div>
    </form>
</body>
</html>

Bill
Top achievements
Rank 1
 answered on 18 Nov 2010
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?