Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
232 views

I am trying to add the radtooltip into an item template of a dynamically created table.  I have the follwing code

  Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn  
            gridLabel = New Label()  
            AddHandler gridLabel.DataBinding, AddressOf gridLabel_DataBinding  
            gridCheck = New CheckBox()  
            AddHandler gridCheck.DataBinding, AddressOf GridCheck_DataBinding  
            gridCheck.Enabled = True 
 
            container.Controls.Add(gridCheck)  
            container.Controls.Add(gridLabel)  
 
        End Sub  
 
        Sub GridCheck_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
            Dim cBox As CheckBox = DirectCast(sender, CheckBox)  
            Dim container As GridDataItem = DirectCast(cBox.NamingContainer, GridDataItem)  
            If DirectCast(container.DataItem, DataRowView)("ContractObjectiveID").ToString <> "0" Then  
                cBox.Checked = True 
            Else  
                cBox.Checked = False 
            End If  
        End Sub  
 
        Public Sub gridLabel_DataBinding(ByVal sender As Object, ByVal e As EventArgs)  
            Dim l As Label = DirectCast(sender, Label)  
            Dim container As GridDataItem = DirectCast(l.NamingContainer, GridDataItem)  
            l.ID = "Label1" 
            l.Text = (DirectCast(container.DataItem, DataRowView))("ObjectiveCode").ToString()  
 
            Dim t As Telerik.Web.UI.RadToolTip = New Telerik.Web.UI.RadToolTip  
            t.Text = (DirectCast(container.DataItem, DataRowView))("Description").ToString()  
            t.Position = ToolTipPosition.MiddleRight  
            t.RelativeTo = ToolTipRelativeDisplay.Element  
            t.TargetControlID = l.ID  
 
        End Sub 


I do not get an error but at the same time I don not get the tooltip to show.  I need to be able to change the grid based on a field in the database.  I have the grid created but need to add the tooltip.  Is this possible?

Daniel
Telerik team
 answered on 27 Apr 2009
1 answer
191 views

Here, i gave client side check/uncheck node child node to parent node as well as parent to child..


 <script type="text/javascript" language="javascript">      
    
 function UpdateAllChildren1(nodes, checked)
{
   var i;
   for (i=0; i<nodes.get_count(); i++)
   {
   
       if (checked)
       {           
           nodes.getNode(i).check();
       }
       else
       {
           nodes.getNode(i).set_checked(false);
       }
       
       if (nodes.getNode(i).get_nodes().get_count()> 0)
       {          
           UpdateAllChildren1(nodes.getNode(i).get_nodes(), checked);         
                        
       }
   }
}
     
 function Checkparentnode(node, isChecked,eventArgs)
 {
            
    if(node.get_parent() != null)
    {
      if(isChecked)
      {
        node.get_parent().set_checked(true);
        Checkparentnode(node.get_parent(), isChecked,eventArgs);
      }
      else
      {
          node.get_parent().set_checked(false);
          Checkparentnode(node.get_parent(), isChecked,eventArgs);
      }
    }            

 }
     
function AfterCheck(childNodes, isChecked,eventArgs)
{          
        
    UpdateAllChildren1(childNodes, isChecked);    
    var node = eventArgs.get_node();
    var parentNode = node.get_parent();    
    var cNodes = eventArgs.get_node().get_nodes();        
    Checkparentnode(node, isChecked,eventArgs);      

}

function clientNodeChecked1(sender, eventArgs)
{
   var childNodes = eventArgs.get_node().get_nodes();   
   var isChecked = eventArgs.get_node().get_checked();
   AfterCheck(childNodes, isChecked,eventArgs);

}
      
</script>
  <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="True"  OnClientNodeChecked="clientNodeChecked1" >
   </telerik:RadTreeView>
Veselin Vasilev
Telerik team
 answered on 27 Apr 2009
3 answers
199 views
I'm using Telerik RadComboboxes in an ASP.NET application, but find myself at a dilemma with using load-on-demand.  When I load the page for an exiting item, my current code depends on the value for certain fields to already exist in the combo, e.g. when I assign a site ID to the SelectedValue of a combo during page load, the callback for loading items fails, somehow because the value doesn't already exist in the combo.

Is there a proper way to handle load on demand for existing items that already have values for combos, when the combos aren't loaded yet, or do I simply have to code my whole form twice, once for inserting new items, and once for editing existing items?

Veselin Vasilev
Telerik team
 answered on 27 Apr 2009
1 answer
152 views
Hi telerik team,

i have a problem while exporting grid to excel,  if it have more than 65,000 records. But it works fine for upto 25000 records. And even it is taking much time while exporting. is there any possibility to export 25000 records per sheet . like that end user can watch all the 65000 records in 3 sheets of same excel sheet.

Advance thanks for any help.
Shinu
Top achievements
Rank 2
 answered on 27 Apr 2009
4 answers
172 views
I have a radgrid on my aspx page, andas far as I can see the ajax component isn't working. The master table has a detail row (sub table) to drill into. When I click on the + sign, the query is being run (as I can see in SQL profiler) but the content isn't being displayed. This is also happening with the paging, I click on the next page icon and it isnt paging. I do have an Ajax scriptmanager on the page.
 
Thank you for your help.

The code for my grid is below (the dataset for the main table is being set in the code behind and is functioning):

  <rad:RadGrid id="radPOS" AutoGenerateColumns="false"   
                AllowPaging="true" 
                Skin="WebBlue" 
                GridLines="Both" 
                OnDetailTableDataBind="RadPOS_DetailTableDataBind" runat="server"   
  Width="970px">  
    
 
 
<MasterTableView  DataKeyNames="PurchaseOrderId"           
                    HierarchyLoadMode="ServerOnDemand">  
 
 
  <detailtables> 
        <rad:GridTableView runat="server" ClientDataKeyNames="PurchaseOrderID" DataKeyNames="PurchaseOrderID" HierarchyLoadMode="Client"   
            DataSourceID="SQLDataSource2" AutoGenerateColumns="false">  
             <ParentTableRelation> 
                            <rad:GridRelationFields DetailKeyField="PurchaseOrderID" MasterKeyField="PurchaseOrderID" /> 
                        </ParentTableRelation> 
 
            <Columns> 
            <rad:GridBoundColumn DataField="InventoryItem" HeaderText="Item"   
                    UniqueName="InventoryItem">  
                      
                </rad:GridBoundColumn> 
               <rad:GridBoundColumn DataField="Description" HeaderText="Description"   
                    UniqueName="Description">  
                </rad:GridBoundColumn> 
                <rad:GridBoundColumn DataField="VendorItemNumber" HeaderText="Vendor Part#"   
                    UniqueName="VendorItemNumber">  
                </rad:GridBoundColumn> 
                <rad:GridBoundColumn DataField="Quantity" HeaderText="Quantity"   
                    UniqueName="column1">  
                </rad:GridBoundColumn>                  
                <rad:GridBoundColumn DataField="UoM" HeaderText="Units"   
                    UniqueName="Uom">  
                </rad:GridBoundColumn> 
                <rad:GridBoundColumn DataField="Price" DataFormatString="{0:c}"   
                    HeaderText="Price" UniqueName="column">  
                </rad:GridBoundColumn> 
                <rad:GridTemplateColumn HeaderText="Line Total">  
                <ItemTemplate> 
                <asp:Label ID="lblPrice" runat="server" Text='<%# string.format("{0:c}",databinder.eval(container,"dataitem.quantity") * databinder.eval(container,"Dataitem.price")) %>'></asp:Label> 
                </ItemTemplate> 
                </rad:GridTemplateColumn> 
                 
            
          
            </Columns> 
        </rad:GridTableView> 
          
    </detailtables> 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn visible="True">  
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
      
        <rad:GridBoundColumn DataField="PurchaseOrderID" DataType="System.Int64"   
            HeaderText="PurchaseOrderID" ReadOnly="True" SortExpression="PurchaseOrderID"   
            UniqueName="PurchaseOrderID" Visible="False">  
        </rad:GridBoundColumn> 
        <rad:GridTemplateColumn ItemStyle-Width="40px" HeaderStyle-Width="40px">  
        <ItemTemplate> 
        <href='<%# "viewpo.aspx?PurchaseOrder=" & databinder.eval(container,"dataitem.PurchaseOrderID") %>' onclick="javascript:window.print();" target="_blank" ><img src="images/printer.png" border="0" alt="Print This PO" /></a>   
        </ItemTemplate> 
        </rad:GridTemplateColumn> 
        <rad:GridTemplateColumn ItemStyle-Width="35px" HeaderStyle-Width="35px">  
        <ItemTemplate> 
        <href='javascript:OpenWindow(<%# databinder.eval(container,"dataitem.PurchaseOrderID")%>)'><img src="images/basket_go.png" border="0" alt="Receive this PO" /></a>  
        </ItemTemplate> 
        </rad:GridTemplateColumn> 
        <rad:GridTemplateColumn ItemStyle-Width="35px" HeaderStyle-Width="35px">  
        <ItemTemplate> 
         <href='<%#"FileUpload.aspx?&PO=" & databinder.eval(container,"dataitem.PurchaseOrderID") & "&height=300&width=300&TB_iframe=true"%>' class="thickbox" ><img alt="files" border="0" src="images/folder_explore.png"></a> 
        </ItemTemplate> 
        </rad:GridTemplateColumn> 
        <rad:GridTemplateColumn ItemStyle-Width="35px" HeaderStyle-Width="35px">          
        <ItemTemplate> 
         <href='<%#"EnterEmail.htm?&PO=" & databinder.eval(container,"dataitem.PurchaseOrderID") & "&height=300&width=300&TB_iframe=true"%>' class="thickbox" ><img alt="email" border="0" src="images/email.png"></a> 
        </ItemTemplate> 
        </rad:GridTemplateColumn> 
        <rad:GridTemplateColumn ItemStyle-Width="35px" HeaderStyle-Width="35px">          
        <ItemTemplate> 
        <href='<%#"EnterFax.htm?&PO=" & databinder.eval(container,"dataitem.PurchaseOrderID") & "&height=300&width=300&TB_iframe=true"%>' class="thickbox" ><img alt="fax" border="0" src="images/page_white_go.png"></a>    
        </ItemTemplate> 
        </rad:GridTemplateColumn> 
          <rad:GridTemplateColumn HeaderText="PO Number" SortExpression="PONumber">  
        <ItemTemplate> 
        <asp:HyperLink id="lnkPo" runat="server" NavigateUrl='<%# "newpurchaseorder.aspx?mode=edit&PO=" & databinder.eval(container,"dataitem.PurchaseOrderID")%>'  Target="_blank" Text='<%# bind("PONumber") %>'></asp:HyperLink> 
        </ItemTemplate> 
        </rad:GridTemplateColumn> 
 
         
          
         
        <rad:GridBoundColumn DataField="OrderTotal" DataType="System.Double"   
            HeaderText="Order Total" ReadOnly="True" SortExpression="OrderTotal"   
            UniqueName="OrderTotal" DataFormatString="{0:c}">  
        </rad:GridBoundColumn> 
        <rad:GridBoundColumn DataField="RequisitionedBy"   
            HeaderText="RequisitionedBy" SortExpression="RequisitionedBy"   
            UniqueName="RequisitionedBy">  
        </rad:GridBoundColumn> 
        <rad:GridBoundColumn DataField="PurchaseOrderDate"   
            DataType="System.DateTime" HeaderText="PO Date"   
            SortExpression="PurchaseOrderDate" UniqueName="PurchaseOrderDate" DataFormatString="{0:d}">  
        </rad:GridBoundColumn> 
        <rad:GridBoundColumn DataField="OrderStatus" HeaderText="OrderStatus"   
            SortExpression="OrderStatus" UniqueName="OrderStatus">  
        </rad:GridBoundColumn> 
        <rad:GridBoundColumn DataField="LastUpdated" DataType="System.DateTime"   
            HeaderText="Last Updated" SortExpression="LastUpdated" UniqueName="LastUpdated">  
        </rad:GridBoundColumn> 
          
    </Columns> 
</MasterTableView> 
 
 <ClientSettings AllowGroupExpandCollapse="True" > 
                    <Selecting AllowRowSelect="true" /> 
                </ClientSettings> 
 
</rad:RadGrid></ContentTemplate></asp:UpdatePanel> 
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"   
        ConnectionString="<%$ ConnectionStrings:BannerSmokedFishConnectionString2 %>"   
        SelectCommand="SELECT * FROM [Purchase_Order_Items] WHERE ([PurchaseOrderID] = @PurchaseOrderID)">  
        <SelectParameters> 
        <asp:SessionParameter Name="PurchaseOrderID" SessionField="PurchaseOrderID" Type="Int64" /> 
              
        </SelectParameters> 
    </asp:SqlDataSource> 
<rad:RadAjaxManager runat="server">  
    <ajaxsettings> 
        <rad:AjaxSetting AjaxControlID="SqlDataSource1">  
            <updatedcontrols> 
                <rad:AjaxUpdatedControl ControlID="radPOS" /> 
            </updatedcontrols> 
        </rad:AjaxSetting> 
        <rad:AjaxSetting AjaxControlID="radPOS">  
        </rad:AjaxSetting> 
        <rad:AjaxSetting AjaxControlID="SqlDataSource2">  
        </rad:AjaxSetting> 
    </ajaxsettings> 
</rad:RadAjaxManager> 
Sebastian
Telerik team
 answered on 27 Apr 2009
1 answer
79 views
We are in the process of converting our whole application away from the older RadControls to the new ASP.NET Ajax versions.
On one of our pages we have allows the user to type into a textbox and the radgrid will rebinded with the results of a search query based on what was typed in box.

after i upgrade the radgrid i have been unable to get this functionality to work.
This is a content page of our master page as well.

here are snippets of what i have so far. 

<

 

telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

 

 

 

<script type="text/javascript" language="javascript">

 

 

 

function RefreshGrid() {

 

 

 

$find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>").ajaxRequest("Rebind");

 

}

 

 

</script>

 

 

 

</telerik:RadScriptBlock>

that is the javascript that does the post backs.

here is the code for the textbox 

 

 

 

txtOrgName.Attributes.Add("onkeyup", "RefreshGrid()");

now i also have this in the page load event

 

 

 

RadAjaxManager ajaxManger = RadAjaxManager.GetCurrent(Page);

 

 

 

if (ajaxManger != null)

 

{

 

 

RadAjaxManager.GetCurrent(Page).AjaxRequest += new RadAjaxControl.AjaxRequestDelegate(ViewCRMRecords_AjaxRequest);

 

}

and here is the code that gets called from the javascript.

 

 

 

protected void ViewCRMRecords_AjaxRequest(object sender, AjaxRequestEventArgs e)

 

{

 

 

switch (e.Argument)

 

{

 

 

case "Rebind":

 

 

 

GridQuickCRMResults.MasterTableView.Rebind();

 

 

 

break;

 

}

}

now..if i put a breakpoint into the code at the line:

 

 

 

GridQuickCRMResults.MasterTableView.Rebind();

everytime i type into the text box...that line does get hit in code...i also traced it all the way through the needdatasource and it all works fine...i get results etc...
however nothing gets displayed on the grid...

 

 

Yavor
Telerik team
 answered on 27 Apr 2009
1 answer
128 views
Hi,

In rad calendar i'm using multiview row and column to display all months in a year, it is displaying 12 months from the current month i.e.,(Apr 09 - mar2010) instead of i need (jan09 - dec09) is there any possiblity to do like this....


Thank you in advance 

by Balaji.T
Shinu
Top achievements
Rank 2
 answered on 27 Apr 2009
1 answer
119 views
Hi,

I have a problem with the RadDatePicker. In IE7 (and only with several more conditions, see below) when picking a Date in the Datepicker-Calender the Date is shown for a moment in the TextBox-part of the Datepicker before I am redirected to the default.aspx of the CMS.

The Program is quite complex so I can only describe the situation:
We use an CMS (ContentXXL) where my code is included as a Usermodule.
The module itself is quite big, so it is separated in several Submodules, loaded as needed with LoadControl.
The Datepicker itself also sits within an UpdatePanel.


In almost all Situations (for example with Firefox, IE8, Opera, without the UpdatePanel, testing inside Visual Studio without the CMS) the Datepicker works as expected, only with IE7 and the Configuration above the problem occurs. Also if the Submodule, in which the Datepicker sits, is the first to be loaded, the problem also does not occur.
The only idea I have how this may happen is that some js is not included for this Datepicker because of the UpdatePanel, but I don't understand why it is working then on other browsers...

Any Idea how I can solve this?


Using:
Telerik Web UI: 2009.1.402.20
ASP.Net 2.0
(Server)OS: Server 2003
IIS: 6.0
Programminglanguage: c#
Pavel
Telerik team
 answered on 27 Apr 2009
2 answers
112 views
Hi,

I have the problem, that the automatic generated InsertForm doesn't display the Default Insert-Button. The Cancel-Button works fine. 

I tried this:
<EditFormSettings> 
    <EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType" UniqueName="EditCommandColumn1"  
InsertImageUrl="../../Skins/Default/Grid/Edit.gif" /> 
</EditFormSettings> 
Doesn't work.

My settings:
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" AllowAutomaticDeletes="True" 
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True" DataSourceID="SqlDataSource1" 
        GridLines="None" BackColor="Gray" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
        Font-Strikeout="False" Font-Underline="False" HeaderStyle-BackColor="Beige" ShowHeader="true" 
        AllowPaging="True" PageSize="10" Width="80%" BorderWidth="0px" ShowStatusBar="true" 
        AllowSorting="True"
        <PagerStyle Mode="NumericPages"></PagerStyle> 
        <MasterTableView CommandItemDisplay="Bottom" DataSourceID="SqlDataSource1" HorizontalAlign="NotSet" 
            DataKeyNames="ID" CurrentResetPageIndexAction="SetPageIndexToFirst" Dir="LTR" 
            Frame="Border" TableLayout="Auto" Font-Bold="False" Font-Italic="False" Font-Overline="False" 
            Font-Strikeout="False" Font-Underline="False" BackColor="#dcdcdc" EditMode="InPlace" 
            AllowMultiColumnSorting="True" AutoGenerateColumns="false"
 
... 
 
        </MasterTableView> 

Hope somebody can help me with this issue.

Regards

Kai


Princy
Top achievements
Rank 2
 answered on 27 Apr 2009
1 answer
106 views
Dear All,

While I handled event "RGList_ColumnEdited", I don't want to grid get auto expanded.
Because I used multi-view and using command name and command arguments, I bring all the data on another view.
I want to restrict edit/update facility inside grid itself.

How can I do it ?

Waiting for Reply.

Thanks.



Princy
Top achievements
Rank 2
 answered on 27 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?