Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
135 views
I have a page using a master page.  The content page includes a tabstrip and multipage combo.  I have created a wizard (based on the sample) where the user fills out part of a form and then clicks on a "Next" button to progress to the next pageview.  The user can not navigate via the tabstrip and serves only as an indicator of the user's progress towards completing the form.

The tabstrip and multipage are contained in a RadAjaxPanel.

Unfortunately some of the forms in each of the views can be pretty lengthy.  When the user clicks on the next button, the pageview changes as desired but it remains scrolled down to the point where the button appeared.  How can I make the page scroll back to the top each time the active pageview changes?

Thanks!!!
Steve LaForge
Top achievements
Rank 1
 answered on 22 Sep 2010
3 answers
129 views

Radlistbox fires both OnClientItemChecked and OnClientSelectedIndexChanged when an item is checked in Firefox and IE but not in Chrome.
Chrome seems to have the proper behavior. Is there a reason for this? Can I make IE and Firefox behave accordingly as well?

<telerik:RadListBox ID="radListBox0" runat="server" Height="400" Width="275"
SelectionMode="Single" CheckBoxes="true" Visible="true"
CssClass="RadListBox_SlidingPanel" EnableEmbeddedSkins="False"
EnableEmbeddedBaseStylesheet="False"
OnClientItemChecked="ListBoxIndexCheckToggled"
OnClientSelectedIndexChanged="ListBoxIndexChanged" />


Brad Bell
Top achievements
Rank 1
 answered on 22 Sep 2010
2 answers
84 views
Hi.

I'm trying to get a 1 digit decimal format (ex: 102.4 or 6.0) instead of getting 2 digits (102.41 or 6.02).

protected void gridReport_ExcelMLExportStylesCreated(object source, GridExportExcelMLStyleCreatedArgs e)
        {
            StyleElement oneDecimalStyle = new StyleElement("oneDecimalStyle");
            oneDecimalStyle.NumberFormat.FormatType = NumberFormatType.Fixed;
            oneDecimalStyle.NumberFormat.Attributes["ss:Format"] = "0/.0";
            e.Styles.Add(oneDecimalStyle);
 }
  
protected void gridReport_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e)
        {
            if (e.RowType == GridExportExcelMLRowType.DataRow)
            {
                CellElement cell = e.Row.Cells.GetCellByName("airDuration");
                cell.StyleValue = "oneDecimalStyle";
             }
        }

What's wrong in my code?
nabilus
Top achievements
Rank 1
 answered on 22 Sep 2010
13 answers
240 views
I'm trying to tweak my menu.  I have it built and have a sample of what it looks like here:
http://www.crhcf.org/images/menu-sample.jpg

1.  Right now the children are left-aligned and I need them right aligned.  I'm using images for the 3 child items.  

2.  How do I define a separator between the child menu items?  For instance I'd like to have two small white lines between the 3 child items like this:  http://www.crhcf.org/images/menu-sample-2.jpg
Right now it has 3 separators from the body gradient which is not what I want.  I don't want a separator under the last item.

3.  I would also like to define a border around the entire child menu and make it the same width as the dark green portion of its parent.

How do I do these things?  Thanks.
dean.carrefour
Top achievements
Rank 1
 answered on 22 Sep 2010
2 answers
149 views
I have been able to export to csv by adding a button to the CommandItemTemplate, then in server side findong the control and setting registerPostBackControl,
    Protected Sub RadGrid1_ItemCreated1(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
 
 ....
 
                Dim btn_excel As LinkButton = TryCast(item.FindControl("btn_excel"), LinkButton)
 
                ScriptManager.GetCurrent(Page).RegisterPostBackControl(btn_excel)
 
 ....
 
End Sub

When fired this calls the export and fires correctly prompting the user to view or download.

However I have changed this to now appear as an item in the headerContextMenu, when the user clicks on the export option, the same code fires in the same order, however instead of exporting it just rebinds the data to the grid, the function i use is below,

Sub buildExport(ByVal type As String)
       RadGrid1.MasterTableView.Columns.Clear()
 
       Dim boundColumn As GridBoundColumn
 
       For Each column As DataColumn In Datasource.Columns
 
           If GridDataKeyNames <> "" Then
               If Not GridDataKeyNames.Contains(column.ColumnName.ToString()) Then
                   If column.ColumnName.ToString().ToLower().IndexOf("_hidden") < 0 And column.ColumnName.ToString().ToLower().IndexOf("rowclick") < 0 Then
 
                       boundColumn = New GridBoundColumn
                       RadGrid1.MasterTableView.Columns.Add(boundColumn)
 
                       boundColumn.DataField = column.ColumnName
                       boundColumn.HeaderText = column.ColumnName.Replace("_", " ")
                   Else
                       boundColumn = New GridBoundColumn
                       RadGrid1.MasterTableView.Columns.Add(boundColumn)
 
                       boundColumn.DataField = column.ColumnName
                       boundColumn.HeaderText = column.ColumnName
 
                       boundColumn.Visible = False
                   End If
 
               Else
 
               End If
           Else
               If column.ColumnName.ToString().ToLower().IndexOf("_hidden") < 0 And column.ColumnName.ToString().ToLower().IndexOf("rowclick") < 0 Then
 
                   boundColumn = New GridBoundColumn
                   RadGrid1.MasterTableView.Columns.Add(boundColumn)
 
                   boundColumn.DataField = column.ColumnName
                   boundColumn.HeaderText = column.ColumnName.Replace("_", " ").ToLower()
               Else
                   boundColumn = New GridBoundColumn
                   RadGrid1.MasterTableView.Columns.Add(boundColumn)
 
                   boundColumn.DataField = column.ColumnName
                   boundColumn.HeaderText = column.ColumnName.ToLower()
 
                   boundColumn.Visible = False
               End If
           End If
 
 
       Next
 
       RadGrid1.DataSource = Datasource
       RadGrid1.DataBind()
 
       RadGrid1.PageSize = Datasource.Rows.Count()
       RadGrid1.ExportSettings.IgnorePaging = True
 
       Select Case type
           Case "excel"
               RadGrid1.ExportSettings.ExportOnlyData = True
               RadGrid1.MasterTableView.ExportToCSV()
           Case "pdf"
               RadGrid1.ExportSettings.OpenInNewWindow = True
               RadGrid1.MasterTableView.ExportToPdf()
       End Select
 
   End Sub

Like i said boths methods in exporting call the same function, but only the contextItem will work.  I am databinding the grid again as the user may have hidden some columns, so this way all coulmns are provided, also needed to remove the boundColumn.DataFormatString = "<nobr>{0:N}</nobr>"
which is created when the grid is loaded to prevent word wrap.

I create the headerMenuItems in the following way

Private Sub addMenuItem(ByVal sender As Object, ByVal e As System.EventArgs)
 
    Dim menu As RadContextMenu = RadGrid1.HeaderContextMenu
    Dim item As New RadMenuItem
    item.Text = "Save Layout"
    item.Value = "save"
    item.Attributes("ColumnName") = String.Empty
    item.Attributes("TableID") = String.Empty
    menu.Items.Add(item)
    item = New RadMenuItem
    item.Attributes("ColumnName") = String.Empty
    item.Attributes("TableID") = String.Empty
    item.Text = "Export to CSV"
    item.Value = "csv"
    menu.Items.Add(item)
 
End Sub

The save Layout works fine (calls GridSettingsPersister)

Any help would be much appreciated.
mabs
Top achievements
Rank 1
 answered on 22 Sep 2010
0 answers
108 views

Hi,

 

I am facing a problem in bachupdate on the radgrid. I have used the same demo as the following(http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/clienteditbatchupdates/defaultcs.aspx).

On the double-click I am changing the row values still I am getting "No pending changes to be processed" all the time. In the demo when we change the values it gives dashes around the data. But in my case the dashes is not coming.  In my row I am only editing 2 columns. one is textbox and other one is dropdown.

 

Can somebody please help me.
 

Thanks.

Jessy

Jessy Joseph
Top achievements
Rank 1
 asked on 22 Sep 2010
1 answer
70 views
Hi,

While edit (timeline) plan in scheduler control, if there is any text selected then the selected text getting disappear after the edit operation. Even though there is no changes happed in edit. Please see the attachment for the detailed understanding.

We are using Telerik version 2008.3.1125.20

Thanks & regards,
Team

Peter
Telerik team
 answered on 22 Sep 2010
6 answers
3.8K+ views
Hi,

In my current project, I have to display a RadGrid which looks as follows http://www.gouw.ws/RadGridWithCheckBoxes.jpg

The RadGrid with paging has 3 columns as follows:
 - Column Name of type GridBoundColumn which can be sorted.
 - Columns Select1 and Select2 of type GridCheckBoxColumn whose values can be modified by the user.

The RadGrid is used to display a data item which is a collection of 1 string value (Name) and 2 boolean values.

I need to modify the RadGrid to look as follows http://www.gouw.ws/RadGridWithCheckBoxesModified.jpg

1. Instead of displaying the string Select1 and Select2 as the titles of the GridCheckBoxColumn,
    I need to display a CheckBox on each Column title and when it is un/checked then all the
    CheckBoxes in the column on the corresponding page will be automatically un/checked.
2. Depending on the value of Name on each row, I need to selectively make Select1 CheckBox
    or Select2 CheckBox not visible (but not both).

The code is given as follows:

ASPX
<body>  
    <form id="form1" runat="server">  
    <div>  
        <telerik:RadScriptManager ID="radScriptManager" runat="server" />  
        <telerik:RadGrid ID="radGrid" AutoGenerateColumns="false" AllowMultiRowEdit="true" AllowPaging="true" AllowSorting="true" PageSize="10" OnNeedDataSource="radGrid_NeedDataSource" OnPreRender="radGrid_PreRender" runat="server">  
            <ClientSettings>  
                <Scrolling UseStaticHeaders="true" />  
            </ClientSettings>  
            <PagerStyle Mode="NumericPages" />  
            <MasterTableView DataKeyNames="Name" EditMode="InPlace" TableLayout="Fixed">  
                <Columns>  
                    <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Name" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowSorting="true" ReadOnly="true" UniqueName="Name" />  
                    <telerik:GridCheckBoxColumn DataField="Select1" DataType="System.Boolean" HeaderText="Select1" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowSorting="false" ReadOnly="false" UniqueName="Select1" />  
                    <telerik:GridCheckBoxColumn DataField="Select2" DataType="System.Boolean" HeaderText="Select2" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" AllowSorting="false" ReadOnly="false" UniqueName="Select2" />  
                </Columns>  
            </MasterTableView>  
        </telerik:RadGrid>      
    </div>  
    </form>  
</body> 

C#
public partial class RadGridWithCheckBoxes : Page  
{  
    private List<Data> _data;  
  
    protected void Page_Load(object sender, EventArgs e)  
    {  
  
        if (!IsPostBack)  
        {  
            this._data = Data.Load();  
            Session["DATA"] = this._data;  
        }  
        else  
        {  
            this._data = (List<Data>)Session["DATA"];  
        }  
    }  
  
    protected void radGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
    {  
        this.radGrid.DataSource = this._data;  
    }  
  
    protected void radGrid_PreRender(object sender, System.EventArgs e)  
    {  
        foreach (GridDataItem item in this.radGrid.Items)  
        {  
            item.Edit = true;  
        }  
        this.radGrid.Rebind();  
    }  
}  
  
public class Data  
{  
    public string Name { getset; }  
    public bool Select1 { getset; }  
    public bool Select2 { getset; }  
  
    public Data(string name, bool select1, bool select2)  
    {  
        Name = name;  
        Select1 = select1;  
        Select2 = select2;  
    }  
  
    public static List<Data> Load()  
    {  
        List<Data> data = new List<Data>();  
        for (int i = 0; i < 25; i++)  
        {  
            data.Add(new Data(String.Format("Data{0}", i), falsefalse));  
        }  
        return data; 
    } 

Can you please show me how to do this?

Regards,
Herman Gouw
 
Tom M
Top achievements
Rank 1
 answered on 22 Sep 2010
1 answer
121 views
I am using the RadUpload control with my ASP.Net form and I have it configured to insert the uploaded files to a SQL database.  This is working perfectly, but the issue is that it also saves the file(s) into the root directory of my application.  Nowhere in my code project does TargetFolder get set....  so my question is, how can I make it stop saving the file to my app directory?  Thanks.
Genady Sergeev
Telerik team
 answered on 22 Sep 2010
2 answers
167 views
Hello
I use e. IsValid = false; in FileUploaded server-side event. But it does not work.
The uploaded image is saving in TargetFolder. Here is my code:

<%@ Page Language="C#" AutoEventWireup="true" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<script runat="server">
  protected void RadAsyncUpload1_FileUploaded(object sender, FileUploadedEventArgs e)
  {
    // here is code for creating and saving thumbnail
    //    ...
 
    e.IsValid = false;    // now we want to discard uploaded image.
                         // But this does not work :(
  
</script>
 
<head runat="server">
    <title></title>
</head>
<body>
 
<form id="form1" runat="server">
 
  <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
  </telerik:RadScriptManager>
 
  <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
        onfileuploaded="RadAsyncUpload1_FileUploaded" TargetFolder="images/_test">
  </telerik:RadAsyncUpload
<asp:Button ID="Button1" runat="server" Text="Button" /> 
 
</form>
</body>
</html>
Genady Sergeev
Telerik team
 answered on 22 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?