Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
128 views
Hello,

Your example that you have on the demo site is for silverlight 3, which uses:

<asp:Silverlight ID="Xaml1" runat="server" Source="~/Chart/Examples/Silverlight/RadChart.xap"
MinimumVersion="2.0.30728.0" Width="100%" Height="100%" OnPluginLoaded="pluginLoaded" />

However, silverlight 4 uses:

<object data="data:application/x-silverlight-2," type="application/x-silverlight-2"
        width="100%" height="100%">
        <param name="source" value="../../ClientBin/Reports.xap" />

Can you provide an example using silverlight 4 with this example:

http://demos.telerik.com/aspnet-ajax/chart/examples/silverlight/defaultcs.aspx

I also need to programmatically pass in values to the chart for different details.

Thanks,

Jason
Evgenia
Telerik team
 answered on 26 Jan 2011
1 answer
277 views
Greetings,

How do I (cast) ServiceParentList.AsEnumerable() this so can make this a DataSource for the Grid?

Please let me know if this correct or there is a better way to do this :)

 protected void radGridRate_DetailTableDataBind(object sender, GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;

            System.Diagnostics.Debug.WriteLine("e.DetailTableView: " + e.DetailTableView.Name);

            switch (e.DetailTableView.Name)
            {
                case "ServiceParent":
                    {
                        radGridRate.MasterTableView.DetailTables[0].ShowHeader = true;

                        string ServiceName = dataItem.GetDataKeyValue("ServiceName").ToString();
                        DataTable dtServiceParent = (DataTable)Session["dtServicesParent"];

                        var ServiceParentList = from tinRecord in dtServiceParent.AsEnumerable()
                                                orderby tinRecord.Field<string>("ServiceName")
                                                where tinRecord.Field<string>("ServiceName") == ServiceName
                                                select new
                                                {
                                                    ServiceName = tinRecord.Field<string>("ServiceName"),
                                                    ParentName = tinRecord.Field<string>("ParentName")
                                                };

                        e.DetailTableView.DataSource = (DataSet) ServiceParentList.AsEnumerable();
etc...

Thanks!
Dave Gilden MCSD / Ft. Worth Tx.

Tsvetoslav
Telerik team
 answered on 26 Jan 2011
0 answers
51 views
Hi,

I have this problem with a website I am working on. It occures as far as I can tell only on Explorer 7 (at least I wasn't able to see it on other browsers), and only when the menu is directed from right to left

It can be viewed on http://www.ope-adhdtest.com/Default.aspx?ln=he

When the page is loaded the top menu direction is from left to right, and only when it finishes loading it flips to the correct direction.

Any known solution for this problem?

Thanks,
Doron

doron
Top achievements
Rank 1
 asked on 26 Jan 2011
4 answers
433 views
i want to hide Appointment context menu and Time slot context menu in RadScheduler.
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Jan 2011
2 answers
241 views
Good day!
I have got simple grid with simple paging.
Possible page size values are 10, 20 and 50 by default. I can set them by checking value in combobox in the bottom of the grid. This is very comfortable. But there are a lot of (more than 10000) items in my grid. So I set PageSize property of my grid for 1000. But now I can set page size only 10, 20, 50 or 1000. But I want to set it to be 100, 200, 500 also. How can I do it without spetial pager templates and using a combobox to set Page Size.

Thank you,
Lina
lina fetisova
Top achievements
Rank 1
 answered on 26 Jan 2011
1 answer
55 views
Hi,
I have for example an appointment with start date and end date at january 25 2011.
But it appears on the 24 of january in timeline view. If I switch to month view it appears on the correct date, 25 of january.

We are using Swedish culture and weeks starts on mondays. FirstDayOfWeek in Scheduler is set to Monday.
Does the timeline view have its own FirstDayOfWeek property or have I missed some other property? Or is is a bug?

Regards,
Mattias
Mattias
Top achievements
Rank 1
 answered on 25 Jan 2011
1 answer
90 views
I'm looking for any suggestions as to what might be going on here. I have a LinkButton that causes data to be inserted into a SQL Server database (via stored procedure), then calls Rebind and DataBind on a RadGrid, which should now show a new row. This page works perfectly on my local computer, but when I promote the code to our production server, the RadGrid does not automatically update -- even though the code is identical. The row is being inserted into the databases, and if I reload the page, the new row shows up in the RadGrid. It's just not showing up immediately and automatically as it should. Again, the identical code is working perfectly on another machine. All the things I can think of checking, and have checked (e.g., that the LinkButton was ajaxified to cause the RadGrid to update), would cause it to fail in both places. But it's working on one server, just not on another.

Any thoughts? I wondered whether the calls the Rebind and DataBind were occurring too quickly, before the row was fully committed into the database, and one server was faster than the other. But I don't see how this could be the case. I'm not doing the database call on a separate asynchronous thread or anything. Plus, this is a page we upgraded from an old version of the Telerik controls (pre ASP.NET AJAX), and it was working fine in the old version too with the old RadGrid and the same stored procedure.

Any ideas? Since I cannot reproduce the behavior locally, I'm totally at a loss for what might be going on.
Jason Fisher
Top achievements
Rank 1
 answered on 25 Jan 2011
5 answers
134 views
I get this error when dropping a RadListView onto the form. There was an error rendering control. The Radlistview control does not have an Item Template specified. All other controls seem to work fine, just this one is throwing an error.

I have Visual Studio 2008 SP1 and have reinstalled the Telerik package.

I am using Q1 2010 AJAX ASP.NET 3.5

thanks
Louis
Top achievements
Rank 1
 answered on 25 Jan 2011
2 answers
104 views

fromRadDateTimePicker.SelectedDate =

DateTime.Today;

 

toRadDateTimePicker.SelectedDate =

DateTime.Today;

 


How do I change fromRadDateTimePicker to set yesterdays date ?
Also how do I set time to 12:01AM ?

Please help thanks
Smiely
Top achievements
Rank 1
 answered on 25 Jan 2011
1 answer
81 views
Hi.
I have a grid and when the user have a row in editmode, the textbox get so small that is not possible to write something in it and in the textbox field a cross i sho
wing. I use a method(SetTextBoxWidth) to regular the width to the column when RadGrid1_ItemDataBound event is called. (The grid is a hierarchy with one level. )  I hope somebody have a clue why this is happening.

The code i am using is as following:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="False" AllowPaging="True" AllowSorting="True" GridLines="None" ShowStatusBar="True"
       Culture="Norwegian, BokmÃ¥l (Norway)" AutoGenerateColumns="False" Width="700px" onitemcommand="RadGrid1_ItemCommand" onitemdatabound="RadGrid1_ItemDataBound"
       onneeddatasource="RadGrid1_NeedDataSource" onupdatecommand="RadGrid1_UpdateCommand">
       <MasterTableView AutoGenerateColumns="False" DataKeyNames="TransId" EditMode="InPlace" CommandItemDisplay="Top">
       <CommandItemTemplate>
           <div style="text-align:right;margin:4px;">
               <asp:LinkButton ID="LinkButtonClose" runat="server" CommandName="CloseAll" ToolTip="Lukk alle radene">Lukk alle</asp:LinkButton>  
               <asp:LinkButton ID="LinkButtonOpen" runat="server" CommandName="OpenAll" ToolTip="Utvid alle radene">Utvid alle</asp:LinkButton>               
           </div>
       </CommandItemTemplate>
       <RowIndicatorColumn><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn>
       <DetailTables>
           <telerik:GridTableView runat="server" AllowPaging="False" DataKeyNames="DetailId" AllowFilteringByColumn="false" EditMode="InPlace" DataSourceID="DetailDataSource">
           <ParentTableRelation><telerik:GridRelationFields DetailKeyField="TransId" MasterKeyField="TransId"/></ParentTableRelation>
           <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>           
           <Columns>  
              <telerik:GridBoundColumn  UniqueName="JourneyTime" HeaderText="Tur" DataField="JourneyTime" ReadOnly="true" SortExpression="JourneyTime">
               <HeaderStyle Width="40px"></HeaderStyle><ItemStyle HorizontalAlign="Left" /></telerik:GridBoundColumn>            
               <telerik:GridBoundColumn  UniqueName="RouteName" HeaderText="Rute" DataField="RouteName" ReadOnly="true" SortExpression="RouteName">
               <HeaderStyle Width="100px"></HeaderStyle></telerik:GridBoundColumn>            
               <telerik:GridNumericColumn  UniqueName="DetailCount" DataType="System.Int32" HeaderText="Antall" DataField="DetailCount" SortExpression="DetailCount">
               <HeaderStyle Width="70px"></HeaderStyle><ItemStyle HorizontalAlign="Left"/></telerik:GridNumericColumn>                                                            
               <telerik:GridNumericColumn  UniqueName="TariffNr" DataType="System.Int32" HeaderText="Billettkode" DataField="TariffNr" SortExpression="TariffNr">
               <HeaderStyle Width="73px"></HeaderStyle><ItemStyle HorizontalAlign="Left"/></telerik:GridNumericColumn>                            
               <telerik:GridNumericColumn  UniqueName="UnitPrice" HeaderText="Pris" DataField="UnitPrice" DataType="System.Double" SortExpression="UnitPrice" DecimalDigits="2">
               <HeaderStyle Width="70px"></HeaderStyle><ItemStyle HorizontalAlign="Left"/></telerik:GridNumericColumn>                             
               <telerik:GridEditCommandColumn CancelText="Avbryt" EditText="Endre" InsertText="Sett inn" UpdateText="Oppdater" UniqueName="EditColumn">
               <ItemStyle HorizontalAlign="Right" /></telerik:GridEditCommandColumn>          
           </Columns>
           <EditFormSettings>
               <EditColumn UniqueName="EditCommandColumn1"></EditColumn>
           </EditFormSettings>
           </telerik:GridTableView>
       </DetailTables>
       <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
       <ExpandCollapseColumn Visible="True"></ExpandCollapseColumn>
       <Columns>
        <telerik:GridBoundColumn  FilterControlWidth="95%" UniqueName="CardNumber" DataField="CardNr" HeaderText="Serienr." ReadOnly="true" DataType="System.Int64" SortExpression="CardNr">
        <HeaderStyle Width="78px"></HeaderStyle><ItemStyle HorizontalAlign="Right" /></telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="TransDate" DataField="TransDate" HeaderText="Dato"  HeaderStyle-Width="150px" ReadOnly="true"></telerik:GridBoundColumn>
       <telerik:GridBoundColumn FilterControlWidth="95%" DataField="UserNr" DataType="System.Int32" HeaderText="Brukernr." ReadOnly="True" SortExpression="UserNr" UniqueName="UserNumberStr">
       <HeaderStyle Width="105px"></HeaderStyle><ItemStyle HorizontalAlign="Right"/></telerik:GridBoundColumn>       
       <telerik:GridBoundColumn FilterControlWidth="95%" DataField="TicketNr" DataType="System.Int32" HeaderText="Billettnr." ReadOnly="True" SortExpression="TicketNr" UniqueName="TicketNumberStr" >
       <HeaderStyle Width="100px"></HeaderStyle><ItemStyle HorizontalAlign="Right"/></telerik:GridBoundColumn>                                  
       <telerik:GridBoundColumn FilterControlWidth="95%" DataField="AnnulComment" HeaderText="Annullerings kommentar" SortExpression="AnnulComment" UniqueName="AnnulComment">
       <HeaderStyle Width="200px"></HeaderStyle></telerik:GridBoundColumn>                 
       <telerik:GridEditCommandColumn CancelText="Avbryt" EditText="Endre" InsertText="Sett inn" UpdateText="Oppdater" UniqueName="EditColumn">
       <HeaderStyle Width="105px"></HeaderStyle><ItemStyle HorizontalAlign="Right" /></telerik:GridEditCommandColumn>     
       <telerik:GridButtonColumn CommandName="Annul" Text="Annuller" UniqueName="AnnulColumn">
       <HeaderStyle Width="60px"></HeaderStyle></telerik:GridButtonColumn>     
       </Columns>
       <NoRecordsTemplate><div>Det er ingen elementer Ã¥ vise</div></NoRecordsTemplate>       
       </MasterTableView>
       <ClientSettings EnableRowHoverStyle="true">                       
           <Resizing AllowColumnResize="true"/>
           <ClientEvents OnRowDblClick="RowDblClick" />
           <Selecting AllowRowSelect="true"/>
       </ClientSettings>
       <SortingSettings EnableSkinSortStyles="False" SortedAscToolTip="Sortert stigende" SortedDescToolTip="Sortet synkende" SortToolTip="Klikk her for Ã¥ sortere" />           
       </telerik:RadGrid>

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item.IsInEditMode)
           {
               SetColumnWidthInEditMode(e);
               if (e.Item.OwnerTableView == RadGrid1.MasterTableView)
               {
                   SetFocusOnField(e, "AnnulComment");
               }           
           }
           else if (e.Item is GridDataItem)
           {
               LoadTransAndDetailValues(e);
           }
       }
 
 
  private void SetColumnWidthInEditMode(GridItemEventArgs e)
       {
           if (!(e.Item is GridDataItem))
               return;
 
           var gridItem = (GridDataItem)e.Item;
           if (e.Item.OwnerTableView == RadGrid1.MasterTableView)
           {
               SetTextBoxWidth(gridItem, "AnnulComment");
           }      
       }
 
 private void SetTextBoxWidth(GridDataItem item, string name)
       {
           TableCell cell = item[name];
           if (cell == null)
               return;
 
           if (cell.Controls.Count > 0 && cell.Controls[0] is TextBox)
           {
               var box = (TextBox)cell.Controls[0];
               box.Width = Unit.Percentage(95);
           }
       }
 
private void LoadTransAndDetailValues(GridItemEventArgs e)
       {
           var item = e.Item as GridDataItem;
           if (e.Item.DataItem is Detail)
           {
               var detail = e.Item.DataItem as Detail;
               if (detail.Trans.AnnulCode > 0)
               {
                   SetRowInAnnulMode(item, true);
               }
 
               item["JourneyTime"].Text = detail.JourneyTime;
               item["RouteName"].Text = detail.RouteName;
 
               double? unitPrice = detail.UnitPrice;
               if (e.Item.IsInEditMode)
               {
                   var ntb = item["UnitPrice"].Controls[0] as RadNumericTextBox;
                   if (ntb != null && unitPrice.HasValue && unitPrice.Value != 0)
                   {
                       ntb.Value = unitPrice.Value / 100.00;
                   }
                   else
                       ntb.Value = null;
               }
               else if (unitPrice.HasValue && unitPrice != 0)
               {
                   item["UnitPrice"].Text = CurrencyFormatting.DoubleToPrice((unitPrice.Value / 100.00));
               }
           }
           else if (e.Item.DataItem is Trans)
           {
               var trans = e.Item.DataItem as Trans;
               if (trans.AnnulCode > 0)
               {
                   SetRowInAnnulMode(item, false);
               }
           }
       }
Pavlina
Telerik team
 answered on 25 Jan 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?