Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
119 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
172 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
148 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
104 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
145 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
318 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
254 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
171 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
106 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
117 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?