Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
137 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
108 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
82 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
2 answers
120 views
How can I use the values of the additional fields server side?.  I'm basically using the same code as this demo
http://demos.telerik.com/aspnet-ajax/upload/examples/additionalfields/defaultcs.aspx

then using this on the server side but the file.GetFieldValue is not working.  can you tell me what I need to do to get the values on the server side?


foreach (UploadedFile file in _RadAsyncUpload1.UploadedFiles)
            {
                string t = file.FileName;
                string q = file.GetFieldValue("Source");
            }
Ted
Top achievements
Rank 1
 answered on 25 Jan 2011
7 answers
275 views
I have a series of panels in my app.  In one of them, there are some pairs of RadListBoxes, as well as some other Telerik controls.  What's happening is I have a LinkButton which opens the panel containing the Telerik controls via an AJAX call.  This shows the panel and hides the others.  The controls all load fine.  I can interact with the controls via AJAX no problem.  The snag occurs when I click on a button I have set to override the AJAX call and perform a full-page postback, hiding the current panel and showing the original one.  When I click the LinkButton again to show the panel containing the RadListBoxes, they don't render, I only see what looks like an unordered list of the listbox items.  This is also happening with some RadComboBox items.  Please advise.  Thanks.
Dimitar Terziev
Telerik team
 answered on 25 Jan 2011
2 answers
162 views
Hey,

I'm running into some problems with the Calendar.  It's related to applying my own CSS to special days.  I basically populate the Calendar with holidays.  They are given a special css class that just has a different background colour.  I'm also using one of the predefined Skins.

On my page, I pre-select the date for the user.  If the date I'm pre-selecting is also a special day I'm running into some odd CSS issues.  It starts with the selected CSS.  If I hover over that date, it uses the Hover CSS which is correct.    But when I move my mouse off of that date it switches back to the special day CSS instead of the selected CSS.  Is there any way I can get it to keep the selected CSS when I move off of that date.
Paul
Top achievements
Rank 2
 answered on 25 Jan 2011
6 answers
141 views
Quick question: am I right in assuming that there are two different versions of RadEditor that work with SharePoint 2007?
  • the full RadEditor
  • RadEditor for MOSS

We have RadEditor for MOSS on our servers, but would like to know why we cannot use the full version. We use the RadEditor to create content for web pages that do have a couple of web parts on - is that why?

We just need a quick explanation on why we cannot use the RadEditor for ASP.NET AJAX even though we have got a couple of other controls from the suite running on our site.

Thanks.

Cindy Mertens
Top achievements
Rank 1
 answered on 25 Jan 2011
1 answer
77 views
Hi Telerik Team

I'm new to Telerik controls  and I'm trying to edit and update the row in the nested grid using custom template. However I cannot get it to work properly, every time I click the edit buttom I'm loosing all the data from the nested grid. I'm using advanced binding for this solution because of both grids are bound to the business objects. Also OnUpdate event gets fired when the edit button is clicked but not Update, so not sure how sould I update the grid ?
I've tried to find some answers online but the the only thing that I was able to fing is how to work with the hierarchical grid which is not what I have.

Please download my demo project that describes the problem from the link below . (Readme.txt included)

https://www.adrive.com/public/339ffcb15bfd1d9b596af104366698a8332d93d70ee7c410a4b34f6ff7b15676.html 

Thanks
Maria Ilieva
Telerik team
 answered on 25 Jan 2011
4 answers
89 views
I have a gvidview that I am attempting to set up so that as I hover over the various rows I get a popup(ascx file)  with the info for that row
When I populate the grid and hover over the items I always receive the popup for the first row regardless which row I hover over.
Any thoughts?

Here is the code for the rowdatabound and the OnAjaxUpdate functions.

protected void gvSelected_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Vehicle v = (Vehicle)e.Row.DataItem;
string avinnumber = v.Vin;
VinRadToolTipManager.TargetControls.Add(e.Row.ClientID, avinnumber, true);
}
}

//**************** Passing Wrong value !!!!!!!!!!!!!!!!!!!!!!!!!!

protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
{
Control ctrl = Page.LoadControl("infovin.ascx");
args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);
InfoVin details = (InfoVin)ctrl;
details.Avinnumber = args.Value;
}

Here is my ToolTipManager and Grid
<telerik:RadToolTipManager ID="VinRadToolTipManager" runat="server" Position="BottomCenter"
Animation="None" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Mouse" Width="350px"
Height="150px" Style="font-size: 18px; text-align: center; font-family: Arial;"
RenderInPageRoot="true" skin="WebBlue" HideEvent="LeaveToolTip" AutoCloseDelay="0" Sticky="false">
</telerik:RadToolTipManager>

 

 

 

 

<table width = "100%">
    <tr>
       
<td align="center" valign="top"> <asp:Label id="srMessage" Font-Bold="true" ForeColor="Red" runat="server"/>
           
<asp:Panel id="multiResults" runat="server">
               
<table width="100%">
                    <tr>
                       
<td align="center">
                             <asp:Label id="lblMultiGrid" Font-Bold runat="server" />


<asp:GridView ID="gvSelected" runat="server" ItemStyle-VerticalAlign=Top align=left AllowPaging="false" onRowDataBound="gvSelected_RowDataBound" OnRowCreated="gvSelected_RowCreated" OnSelectedIndexChanged="gvSelected_SelectedIndexChanged" PageSize="15" AutoGenerateColumns="False" ShowFooter="false" Width="100%" >

        
<Columns>
           
<asp:BoundField HeaderText="VIN" DataField="Vin" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="Year" DataField="Modelyear" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="Manufacturer" DataField="Make" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="Model" DataField="Model" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="Body Style" DataField="Bodystyle" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="Coll" DataField="Collsymbol" HeaderStyle-HorizontalAlign="Left"/>    
           
<asp:BoundField HeaderText="Comp" DataField="Compsymbol" HeaderStyle-HorizontalAlign="Left"/>
           
<asp:BoundField HeaderText="VSR" DataField="symbol" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="AntiTheft" DataField="Antitheft" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="Passive Restraint" DataField="Restraint" HeaderStyle-HorizontalAlign="Left"/>
           <asp:BoundField HeaderText="AntiLock Brakes" DataField="Antilockbrakes" HeaderStyle-HorizontalAlign="Left"/>
        </Columns>
</asp:GridView>

 

 

 

</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</asp:Panel>

 

 

 

 

 

Chuck Lawson
Top achievements
Rank 1
 answered on 25 Jan 2011
1 answer
106 views
I've been at this for 3 days  and I'm either dense or this isn't as easy as it should be.
If you look at the RadScheduler demo (I attached a snapshot) you will see a PanelBar in the bottom left that displays the users 'calendars'. I need to build this PanelBar, dynamically, from SQL in VB and I cannot get my head around how to do this. I have tried the various demos etc and had varying degrees of luck mostly with binding the children. 
I also would like to create the checkbox item with 'autopostback' set to true but can live with client side code if required.

Can someone point me at a similar effort or supply me a sample of the code I require to do this.

 
Simon
Telerik team
 answered on 25 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?