Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
151 views
Hi,

I'm having a problem with the X and Y axis titles of a ScatterLine Chart. I am binding data to the chart server-side and when I add no series to the chart then the Axis Titles display fine. However, when I add a list of ScatterLineSeries via the PlotArea.Series.AddRange function then the data gets added, but my Axis Titles disappear. I've tried setting the Axis Titles in the ASP markup at design time and via C# code but neither seem to do anything. Note: In the server-side C# code I only tried setting the X-Axis title.

Please see my code blocks below:
public void BindWaterFlowRateChart(List<ScatterLineSeries> WaterFlowRateSeries)
        {
            WaterFlowRateChart.PlotArea.Series.Clear();
            WaterFlowRateChart.PlotArea.Series.AddRange(WaterFlowRateSeries);
            WaterFlowRateChart.Legend.Appearance.Visible = true;
            WaterFlowRateChart.PlotArea.XAxis.AxisCrossingValue = 0;
            WaterFlowRateChart.PlotArea.XAxis.Visible = true;
            WaterFlowRateChart.PlotArea.XAxis.TitleAppearance.Text = "Time (min)";
            WaterFlowRateChart.PlotArea.XAxis.TitleAppearance.Position = AxisTitlePosition.Center;
            WaterFlowRateChart.PlotArea.XAxis.TitleAppearance.Visible = true;
        }
 
<telerik:RadHtmlChart runat="server" ID="WaterFlowRateChart">
            <ChartTitle Text="Water Flow Rate Summary" />
            <Legend>
                <Appearance BackgroundColor="White" Position="Right"></Appearance>
            </Legend>
            <PlotArea>
                <XAxis AxisCrossingValue="0">
                    <TitleAppearance Text="Time (min)" Position="Center" Visible="True" />
                </XAxis>
                <YAxis AxisCrossingValue="0">
                    <TitleAppearance Text="Flow Rate (gal/min)" Position="Center" Visible="True" />
                </YAxis>
            </PlotArea>
        </telerik:RadHtmlChart>
Tim Johnson
Top achievements
Rank 1
 answered on 06 Feb 2013
4 answers
233 views
Hi guys,

I have a RadComboBox that is bound through EntityDataSource. I also added default item, but I need to be able to access that default item on postback in codebehind, because currently I always get the first item in SelectedValue property, that comes from the collection from EntityDataSource. Basically the control is not mandatory and user does not need to select any value.

Here is the code I have been trying to get working:

<telerik:RadComboBox ID="rcbWarehouse" runat="server" DataSourceId="edsWarehouse"
DataValueField="ID" DataTextField="Name" validationGroup="vgOrder">
         <DefaultItem runat="server" Value="null" Text="<%$ Resources: DirectDelivery %>" />
</telerik:RadComboBox>

Thank you!

P.
Patrik
Top achievements
Rank 1
 answered on 06 Feb 2013
2 answers
135 views
Hello,

I am using a grid to load a dataview similar to your WebMail example.  I can select the first row and load dataview on page load.  I can load dataview on row selection, but I cannot figure out how to load first row on grid sort function.  I have tried using pre render which works, but then row selected command does not work.  On your WebMail example you use the grid as your parameter value for the link data source of the dataview.  I am using a custom dataset from data layer, so cannot use the same way.  How can I get similar functionality?  If I use a sessin variable it never loads new selection, but if I put selected grid value in textbox on client side, then get value I can load dataview except on sort.

Imports System
Imports System.Data
Imports Message
 
Imports Telerik.Web.UI
Partial Class Messages
    Inherits System.Web.UI.Page
    Protected m As New Message
 
 
    Dim isSelected As Boolean
    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            Session("SelectedView") = "Inbox"
            RadGrid1.Rebind()
            SelectFirstGridRow()
            LoadMessage()
        Else
            LoadMessage()
        End If
    End Sub
    Protected Sub RtvMessageslNodeClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTreeNodeEventArgs) Handles RtvMessages.NodeClick
        Select Case e.Node.Text
            Case "Inbox"
                Session("SelectedView") = "Inbox"
                Exit Select
            Case "Sent"
                Session("SelectedView") = "Sent"
                Exit Select
            Case "Agency"
                Session("SelectedView") = "Deleted"
                Exit Select
        End Select
 
        RadGrid1.Rebind()
    End Sub
    Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
        Dim listtype As String '= "Inbox"
        listtype = RtvMessages.SelectedNode.Text
        'testout.Text = listtype
        Select Case listtype
            Case "Sent"
                RadGrid1.MasterTableView.GetColumn("ToUserFullName").Visible = True
                RadGrid1.MasterTableView.GetColumn("FromUserFullName").Visible = False
            Case "Deleted"
                RadGrid1.MasterTableView.GetColumn("FromUserFullName").Visible = True
                RadGrid1.MasterTableView.GetColumn("ToUserFullName").Visible = False
            Case Else
                RadGrid1.MasterTableView.GetColumn("FromUserFullName").Visible = True
                RadGrid1.MasterTableView.GetColumn("ToUserFullName").Visible = False
        End Select
        Dim errors As String = ""
        RadGrid1.DataSource = Message.GetMessageList_outlookformat(Membership.GetUser(User.Identity.Name).ProviderUserKey, listtype, errors)
        'testout.Text = errors
 
    End Sub
    Protected Sub RadGrid1_RowSelected(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs)
        Session("SelectedMessage") = RadGrid1.SelectedValue.ToString
        LoadMessage()
        Dim errors As String = ""
    End Sub
    Sub Checkisnew(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
        If TypeOf e.Item Is Telerik.Web.UI.GridDataItem Then
 
            Dim checkrow As DataRowView
            checkrow = e.Item.DataItem
 
            Dim i As New HtmlImage
            i = e.Item.FindControl("mailicon")
            'Dim i2 As New HtmlImage
            'i2 = e.Item.FindControl("replyicon")
 
            If checkrow.Row("IsNew") Then
                i.Src = "images/icon-msg-unread.gif"
            ElseIf checkrow.Row("RepliedTo") Then
                i.Src = "images/icon-msg-reply.gif"
            ElseIf checkrow.Row("Forwarded") Then
                i.Src = "images/icon-msg-forward.gif"
            Else
                i.Src = "images/icon-msg-read.gif"
            End If
 
            'If checkrow.Row("RepliedTo") Then
            '    i2.Src = "images/reply.gif"
            'Else
            '    i2.Src = "images/spacer.gif"
            '    i2.Visible = False
            'End If
 
            'i2 = e.Item.FindControl("forwardicon")
            'If checkrow.Row("Forwarded") Then
            '    i2.Src = "images/forward.gif"
            '    i2.Style.Add("margin-left", "2px")
            'Else
            '    i2.Src = "images/spacer.gif"
            '    i2.Visible = False
            'End If
            Dim dt As DateTime = checkrow("DateCreated")
            e.Item.Cells(7).Text = dt.ToShortDateString & " " & dt.ToShortTimeString
 
        End If
 
 
    End Sub
    Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles RadGrid1.PreRender
        'If (RadGrid1.MasterTableView.Items.Count > 0) Then
        '    If RadGrid1.SelectedItems.Count = 0 Then
        '        RadGrid1.MasterTableView.Items(0).Selected = True
        '        Session("SelectedMessage") = RadGrid1.SelectedValue.ToString
        '        LoadMessage()
        '    Else
        '        LoadMessage()
        '    End If
        'End If
    End Sub
    Private Sub SelectFirstGridRow()
        Dim firstDataItem As GridDataItem = RadGrid1.Items.OfType(Of GridDataItem).FirstOrDefault()
        If firstDataItem IsNot Nothing Then
            firstDataItem.Selected = True
            If Session("SelectedMessage") Is Nothing Then
                Session("SelectedMessage") = RadGrid1.SelectedValue.ToString
            End If
        End If
 
    End Sub
    Sub Deletemessage(ByVal sender As Object, ByVal e As EventArgs)
        m.Load(RadGrid1.SelectedValue)
        m.MarkForDeletion()
        Dim intpage As Integer
        intpage = RadGrid1.CurrentPageIndex
        RadGrid1.Rebind()
        RadGrid1.CurrentPageIndex = intpage
    End Sub
    Sub LoadMessage()
        Dim messageGuidIn As String
        Dim guidin As Guid
        Dim mv As DetailsView = DetailsView1
        Dim ds As DataSet
        If RadGrid1.Items.Count > 0 Then
            Dim selectedTextBox As RadTextBox = DirectCast(DirectCast(RadToolBar1.FindButtonByCommandName("selectedText"), RadToolBarButton).FindControl("RadTextBox1"), RadTextBox)
            If selectedTextBox.Text = String.Empty Then
                messageGuidIn = RadGrid1.SelectedValue.ToString
            Else
                messageGuidIn = selectedTextBox.Text
            End If
 
 
            guidin = New Guid(messageGuidIn)
            ds = Message.GetMessage(guidin)
            If ds.Tables.Count > 0 Then
                m.Load(guidin)
                If m.IsNew Then
                    m.ChangeIsNew()
                End If
            End If
            mv.DataSource = ds
            mv.DataBind()
        End If
    End Sub
    Protected Sub RadAjaxManager1_AjaxRequest(sender As Object, e As AjaxRequestEventArgs)
        Dim intpage As Integer
 
        intpage = RadGrid1.CurrentPageIndex
        RadGrid1.Rebind()
        RadGrid1.CurrentPageIndex = intpage
        LoadMessage()
 
    End Sub
 
 
End Class
Bryan Hughes
Top achievements
Rank 1
 answered on 06 Feb 2013
3 answers
193 views
Hello,
My task is to hide certain columns in details table based on a property of master table. I have attached an image of what I'm trying to achieve. 

In the attachment

1. for each customer Id ending with I, I will have to hide Freight Column and if it ends with N, I will have to hide date ordered column. 
2. I will also have to hide in the details table the add new record button for CustomerIds starting with A. 

I appreciate your help if you can point me to the right direction. 
Abe

J
Top achievements
Rank 1
 answered on 06 Feb 2013
4 answers
199 views
Hello,

RadControls For ASP.NET AJAX v2009.1.527.35

I have a RadWindow that contains a RadGrid for search results and a RadToolbar with a Search button.

The RadWindow auto-sizes when it is first displayed which is working fine.  The RadGrid has a page size of 10 rows, and allows paging.  Paging is working fine as well, but when I get to the last page (which has fewer than 10 rows) the RadGrid shrinks and leaves space below it.  I want the RadWindow to resize when this happens.  I have Javascript code to handle resiging the RadWindow so I would like do this client-side.  My problem is I don't know what event to hook into after the RadGrid paging so that I can then call the resize code.

I saw in this form mention of the "OnClientPageLoad" event for the RadGrid but apparently that is only in a newer version of RadControls, and unfortunately upgrading is not an option at this time.

I have attached screenshots showing what is happening.

Picture 1 shows the RadWindow resized correctly, picture 2 shows what happens on the last page when there are fewer rows.

Thanks,
Randall Price
Virginia Tech
Randall
Top achievements
Rank 2
 answered on 06 Feb 2013
0 answers
130 views
I'd like to get a clear answer on whether the AutoGenerateHierarchy property of RadGrid for ASP.NET AJAX (in a .NET WebForms application context) supports object-relational business objects.
 

The AutoGenerateHierarchy property itself is valid*, but seems to behave differently in the case of WebForms rather than WinForms** applications & I'm finding the Telerik documentation around this ambiguous. 

The property description*** reads like the DataSoruce value would have to be of type DataSet for AutoGenerateHierarchy to work. Additionally, all of the ASP.NET AJAX-specific examples I find so far assign a RadGrid DataSource of type DataSet.

However, the DataSource property itself, of course, does not have to be assigned to an object of type DataSet.****


Further, if not supported (combining a non-DataSet DataSource with AutoGenerateHierarchy='True'), shouldn't we expect an error message or warning?
I'm not getting any errors trying to apply this in testing scenarios (just silent failure on any hierarchy).  To recreate set - AutoGenerateHierarchy to 'True' in a bare-bones RadGrid where the DataSource is bound to a very simple object graph on Page_Load. Make one of the properties of the top-level object (top parent in the hierarchy) a list of another simple object.  This should generate a flat grid (no hierarchy/nesting), but not error out.




Products + Scenario : 
RadControls for ASP.NET AJAX
Telerik.Web.UI Version  2012.3.1308.40 (v4.0.30319)

.NET WebForms



References: 
* http://www.telerik.com/help/aspnet-ajax/allmembers_t_telerik_web_ui_radgrid.html
**http://www.telerik.com/help/winforms/gridview-hierarchical-grid-object-relational-hierarchy-mode.html
***http://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radgrid_autogeneratehierarchy.html
****http://www.telerik.com/help/aspnet-ajax/p_telerik_web_ui_radgrid_datasource.html

Karrie
Top achievements
Rank 1
 asked on 06 Feb 2013
1 answer
107 views
Hi, 

Hi,

I need to export excel. 

I am using   RadGrid1.MasterTableView.ExportToExcel();

Everything is ok. I can export. But one of my columns is 25-26 digit. For example

My grid is;

Barcode(datatype:text)--------------code(datetype:text)
10105570021112201100001------125
10105570072610201100001------110          
10105570020112201100001------165


When I push the button. My excel is coming this type. 

Barcode----------------Code       
1.01056E+22 ---------125 
1.01056E+22----------110
1.01056E+22-----------165


After export. İf I change "format cells" in the excel. My barcode is changing this type

10105570021112200000000
 10105570072610200000000
 10105570020112200000000

How can ı solve? 

p.s.: Sorry my english
Kostadin
Telerik team
 answered on 06 Feb 2013
5 answers
196 views
Good morning, all.

I have a question regarding the RadGrid's grouping feature.  I have an Ajaxified grid binding from a web service, which is allowing grouping and sorting.  I also have a separate form that allows users to specify a default grouping level if they so choose.  The value is then written to a table in the database.

On the grid's PreRender event, I'm doing a check to see if there are any custom grouping levels specified.  If so, I'm able to apply the group to the grid with "RadGrid1.MasterTableView.GroupByExpressions.Add("Group By " & val)" and it renders fine.  The issue I'm having is that no other grouping can be applied due to an index error, and this level can't be removed (same index error).  I'm only doing the database check the first time the page is loaded so ideally, the user should be able to remove the default group and have it return on the next page load (unless they specify a different default).

As a side note, if the user doesn't have a default group specified, there's no problem with the grid's grouping features at all.

Is there something else I need to do besides add the GroupByExpression in order to enable my dynamic grouping to function with groups dragged to the header row?

Thanks!

/jeff
Angel Petrov
Telerik team
 answered on 06 Feb 2013
14 answers
397 views
Hi,

I am writing under the assumption that if you add a detail table to a master table, the detail table will have by default, the Add New Record link at the top left. I see this for my master table, but the detail table does not display any Add Record option and I need one. Any clues on what to look for? Thanks.
Daniel
Telerik team
 answered on 06 Feb 2013
1 answer
55 views
Hello,

Select any image from Content and then Click on Image Manger from Editor , Pop up unwanted Message , i need your help to remove it.

FYI >> Facing this problem across all the browsers.

Regards
Samir
Rumen
Telerik team
 answered on 06 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?