Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
88 views
Dear Telerik.
I am a beginner ASP.NET AJAX (Visual studio 2010 (4.0)).

 I want to Telerik help me code with '3 tier', use SQL Server (2008): same this website: http://demos.telerik.com/aspnet-ajax/carrental/

 However, my only concern is this part same bellow image:
Image 'snapshot_2013-04-28_144645.png'. Hover over a Item Car Product a tooltip appearance have any Information of that Item Car Product.

 And when click Item(a car product) appearance a window same bellow image:
Image link 'snapshot_2013-04-28_150445.png'

I don't need Tab 'Schedule & Reservation' only need Tab 'Information'.

If can, Telerik detailed instructions by "file.doc" step by step, I can learn.
Thank you Telerik.

Trân nhân
Top achievements
Rank 1
 asked on 28 Apr 2013
0 answers
152 views
Hi,
I have a combo box in edit mode of a telerik grid, but I am getting null value for selected value on onchange event. Please see code below

partail view:

 

 

Html.Telerik().ComboBox().Name("StyleImage").ClientEvents(events => events
.OnChange("onChange")
 )

here is js code

function onChange(e) {
    alert(e.value);
}

 here is grid onedit

function Grid_onEdit(e) {
           var styleImage = $('#StyleImage').data('tComboBox');
            $.getJSON(appUrl("Controller/Action"),
                { styleId: styleValue },
                function (data) {
                    styleImage.dataBind(data.value);
                    styleImage.value(e.dataItem['DefaultImage']);
                }
            );
        }
 
    }

 Here is controller code

public JsonResult Action(string styleId)
       {
          List<string> images=new List<string>();           
          return Json(new { success = true, value = images }, JsonRequestBehavior.AllowGet);
       }

this is how I am seeing rendered code for combo box
<div class="t-animation-container" style="width: 150px; height: 214px; position: absolute; z-index: 10002; top: 382.817px; left: 599.733px; display: none;">

<div class="t-popup t-group" style="display: block; height: auto; overflow: auto; width: 148px; margin-top: -214px;">
<ul class="t-reset">
<li class="t-item" unselectable="on">GWTUTU2-BRMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-PIMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-SILTX</li>
<li class="t-item t-state-selected" unselectable="on">GWTUTU2-BLMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-YELLL</li>
<li class="t-item" unselectable="on">GWTUTU2-MPILL</li>
<li class="t-item" unselectable="on">GWTUTU2-DPILL</li>
<li class="t-item" unselectable="on">GWTUTU2-BUMLL</li>
<li class="t-item" unselectable="on">GWTUTU2-BLKLL</li>
<li class="t-item" unselectable="on">GWTUTU2-DGRLL</li>
</ul>
</div>
</div>



Thanks..
simmaneni
Top achievements
Rank 1
 asked on 28 Apr 2013
0 answers
139 views

I figured out how to set defaults for the multiple check boxes.

Here is my example:

DataTable tableMonths = new DataTable();
tableMonths.Columns.Add("name", typeof(int));
tableMonths.Columns.Add("value", typeof(string));
tableMonths.Rows.Add(12, "12");
tableMonths.Rows.Add(24, "24");
tableMonths.Rows.Add(36, "36");
tableMonths.Rows.Add(48, "48");
tableMonths.Rows.Add(60, "60");
tableMonths.Rows.Add(72, "72");
RadComboBoxMonths.DataSource = tableMonths;
RadComboBoxMonths.DataTextField = "name";
RadComboBoxMonths.DataValueField = "value";
RadComboBoxMonths.DataBind();
// preselect these terms by default
RadComboBoxMonths.SelectedValue = "12";
RadComboBoxItem twelveMonths = (RadComboBoxItem)RadComboBoxMonths.SelectedItem;
twelveMonths.Checked = true;
RadComboBoxMonths.SelectedValue = "24";
RadComboBoxItem twentyFourMonths = (RadComboBoxItem)RadComboBoxMonths.SelectedItem;
twentyFourMonths.Checked = true;
RadComboBoxMonths.SelectedValue = "36";
RadComboBoxItem thritySixMonths = (RadComboBoxItem)RadComboBoxMonths.SelectedItem;
thritySixMonths.Checked = true;
Mike
Top achievements
Rank 1
 asked on 27 Apr 2013
1 answer
69 views
Hi,
I am reading an excel spreadsheet and need to load a radgrid manually 1 row at at time.  Is there any good example code on how to programatically create radgrid headers and load data without using a datasource.

Thanks.
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Apr 2013
1 answer
99 views
HI,

I followed the code example from here: http://demos.telerik.com/aspnet-ajax/grid/examples/programming/alphabeticpaging/defaultvb.aspx?#qsf-demo-source

Now the Alpha paging works great but the numeric paging when I click on any page it comes completely balnk
When I click on enable sorting and click on it comes blank

Is there something missing in the demo site code
<%@ Page Title="" Language="VB" MasterPageFile="~/AdminPanel/Admin.master" AutoEventWireup="false" CodeFile="pager_test.aspx.vb" Inherits="AdminPanel_franchise_pager_test" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
  
    <br />
    <hr />
    <div style="border: 5px solid #eaf2fd; width: 95%;">
        <telerik:RadGrid ID="RadGrid2" DataSourceID="SqlDataSource2" AllowPaging="True" PageSize="5"
            runat="server" GridLines="None" Width="100%" AllowSorting="True"
            CellSpacing="0">
            <PagerStyle Mode="NextPrevAndNumeric" EnableSEOPaging="False"></PagerStyle>
            <HeaderStyle HorizontalAlign="Center"></HeaderStyle>
            <ItemStyle HorizontalAlign="Center"></ItemStyle>
            <AlternatingItemStyle HorizontalAlign="Center"></AlternatingItemStyle>
            <MasterTableView CommandItemDisplay="Top">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"
                    Created="True"></ExpandCollapseColumn>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
                <CommandItemTemplate>
                    <asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
                </CommandItemTemplate>
            </MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
        </telerik:RadGrid>
    </div>
    <br />
  
    <asp:SqlDataSource ID="SqlDataSource2" runat="server"  ConnectionString="<%$ ConnectionStrings:SQL %>"
         
        SelectCommand="SELECT [a], [b], [c], [d], [e] FROM [franchises] WHERE ([xyz] LIKE @xyz)">
        <SelectParameters>
            <asp:Parameter Name="xyz" Type="String" DefaultValue="%" />
        </SelectParameters>
    </asp:SqlDataSource>
 
</asp:Content>

Protected Sub RadGrid2_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid2.ItemCreated
       If TypeOf e.Item Is GridCommandItem Then
           Dim commandItem As GridCommandItem = CType(e.Item, GridCommandItem)
           Dim container As PlaceHolder = commandItem.FindControl("PlaceHolder1")
 
           Dim i As Integer
           For i = 65 To 65 + 25
               Dim linkButton1 As New LinkButton
               Dim lc As New LiteralControl("  ")
               linkButton1.Text = "" + ChrW(i)
 
               linkButton1.CommandName = "alpha"
               linkButton1.CommandArgument = "" + ChrW(i)
 
               container.Controls.Add(linkButton1)
               container.Controls.Add(lc)
           Next i
 
           Dim lcLast As New LiteralControl(" ")
           container.Controls.Add(lcLast)
 
           Dim linkButtonAll As New LinkButton
           linkButtonAll.Text = "All"
           linkButtonAll.CommandName = "NoFilter"
           container.Controls.Add(linkButtonAll)
       End If
   End Sub
 
   Protected Sub RadGrid2_ItemCommand(ByVal source As Object, ByVal e As GridCommandEventArgs) Handles RadGrid2.ItemCommand
       Dim value As String = Nothing
       Select Case e.CommandName
           Case ("alpha")
               value = String.Format("{0}%", e.CommandArgument)
               Exit Select
           Case ("NoFilter")
               value = "%"
               Exit Select
       End Select
       SqlDataSource2.SelectParameters("xyz").DefaultValue = value
       RadGrid2.Rebind()
   End Sub

Pavlina
Telerik team
 answered on 26 Apr 2013
0 answers
234 views
Hi,

I am trying to get monthly wise details from treeview.

1. I can able to bind the Treeview details, 
2. Once the user clicks the month , i need to show the monthly wise details on the Grid. 

I have tried to get the Grid from radtreenode, I failed. Please help me out from this

Please find the below code for your reference.

<telerik:RadTreeView ID="treeViewClientBudget" runat="server" OnNodeClick="treeViewClientBudget_NodeClick">
                        
                        
                        <Nodes>
                            
                            <telerik:RadTreeNode  Text="BudgetNode">
                                
                                <NodeTemplate>
                                    

                                    <telerik:RadGrid ID="grdBudgetDetail" Width="85%" BorderWidth="0" GridLines="None"
                                        runat="server"
                                        AutoGenerateColumns="False">
                                        <ClientSettings>
                                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                        </ClientSettings>

                                        <MasterTableView DataKeyNames="Month,Year" HierarchyLoadMode="ServerOnDemand">



                                            <DetailTables>
                                                <telerik:GridTableView runat="server"
                                                    DataKeyNames="Month,Year,ClassificationId" Name="Classification">
                                                    <Columns>
                                                        <telerik:GridBoundColumn DataField="ClassificationName"
                                                            FilterControlAltText="Filter Division column" UniqueName="ClassificationName" HeaderText="Classification Name">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="ActualForecast"
                                                            HeaderText="Actual Forecast"
                                                            UniqueName="ActualForecast">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn DataField="BudgedForecast"
                                                            HeaderText="Budged Forecast"
                                                            UniqueName="BudgedForecast">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <DetailTables>

                                                        <telerik:GridTableView runat="server" Name="Vendor"
                                                            DataKeyNames="Month,Year,ClassificationId,VendorId">

                                                            <Columns>

                                                                <telerik:GridBoundColumn DataField="VendorName"
                                                                    FilterControlAltText="Filter Division column" UniqueName="VendorName" HeaderText="Vendor Name">
                                                                </telerik:GridBoundColumn>

                                                                <telerik:GridBoundColumn DataField="ActualForecast"
                                                                    HeaderText="Actual Forecast"
                                                                    UniqueName="ActualForecast">
                                                                </telerik:GridBoundColumn>

                                                                <telerik:GridBoundColumn DataField="BudgedForecast"
                                                                    HeaderText="Budged Forecast"
                                                                    UniqueName="BudgedForecast">
                                                                </telerik:GridBoundColumn>

                                                            </Columns>
                                                        </telerik:GridTableView>
                                                    </DetailTables>
                                                </telerik:GridTableView>

                                            </DetailTables>

                                            <Columns>
                                                <telerik:GridBoundColumn DataField="Month" FilterControlAltText="Filter 

Division column"
                                                    HeaderText="Month">
                                                </telerik:GridBoundColumn>

                                                <telerik:GridBoundColumn DataField="Year" FilterControlAltText="Filter 

Division column"
                                                    HeaderText="Year">
                                                </telerik:GridBoundColumn>

                                                <telerik:GridBoundColumn DataField="ActualForecast" HeaderText="Actual($) "
                                                    UniqueName="ActualForecast">
                                                </telerik:GridBoundColumn>

                                                <telerik:GridBoundColumn DataField="BudgedForecast" HeaderText="Budged ($)"
                                                    UniqueName="BudgedForecast">
                                                </telerik:GridBoundColumn>

                                            </Columns>

                                        </MasterTableView>

                                    </telerik:RadGrid>

                                </NodeTemplate>
                            </telerik:RadTreeNode>
                        </Nodes>
                        
                    </telerik:RadTreeView>


#.CS 

 protected void treeViewClientBudget_NodeClick(object sender, RadTreeNodeEventArgs e)
    {
        for (int i = 0; i < treeViewClientBudget.Nodes.Count; i++)
        {
            if (i==e.Node.Index)
            {
                RadTreeNode budgetNode = treeViewClientBudget.Nodes[i].TreeView.FindNodeByText("BudgetNode");
                   RadGrid grid = (RadGrid)treeViewClientBudget.Nodes[i].FindControl("grdBudgetDetail");
            }
         
          
        }


Regards,
Saravanan M
Saravanan
Top achievements
Rank 1
 asked on 26 Apr 2013
1 answer
681 views
Hi all,

I have the following simple grid.

<telerik:RadGrid ID="grdMyGrid" runat="server" 
   AutoGenerateColumns="false"
   OnNeedDataSource="grdNewEpidomaTheshs_NeedDataSource">
   <MasterTableView EditMode="InPlace"  CommandItemDisplay="Top" 
      CommandItemSettings-AddNewRecordText="Add new record">
       
      <
NoRecordsTemplate>No records available</NoRecordsTemplate>
      <Columns> ... some columns ...</Columns>
   </MasterTableView>
</telerik:RadGrid>

All I want to do is hide the row containing the "add new record" when another row is in edit mode, i.e. when the edit button has been 
clicked
Giorgos
Top achievements
Rank 1
 answered on 26 Apr 2013
2 answers
73 views
Hi;

We would like to swap out the standard menu and use the ribbon menu instead. Is there a way to do this?

thanks - dave
David Thielen
Top achievements
Rank 1
 answered on 26 Apr 2013
3 answers
164 views
Hello,

I am creating a RadGrid programmatically in the Page_Init. One of my columns I need to use the GridTemplateColumn to show a text box. The text box will initially come up with a numeric value. The user has the ability to change the value in the text box. The value is required and needs to be an integer. Once they have typed their new value and focus is lost from the text box, I would like to gather some other information on the same row, run some javascript to show a message with not only the new value they typed in but some of the other information on the row. I cannot seem to figure out how to do this. I have it where the grid shows with the correct information and text box in the column. The user can change the value. Here is where I need help. Once the textbox loses focus I would like to do some javascript on the new value and other values associated to the row the textbox is on. Below is my code to create the columns.

Page_Init
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
    'CODEGEN: This method call is required by the Web Form Designer
    'Do not modify it using the code editor.
    InitializeComponent()
    defineGridStructure()
End Sub

defineGridStructure
Private Sub defineGridStructure()
    RadGrid1.ID = "RadGrid1"
    RadGrid1.Width = Unit.Pixel(1500)
    RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace
    RadGrid1.AllowPaging = True
    RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric
    RadGrid1.AutoGenerateColumns = False
    RadGrid1.ShowStatusBar = True
    RadGrid1.AllowSorting = True
    RadGrid1.AllowFilteringByColumn = True
    RadGrid1.Skin = "WebBlue"
    RadGrid1.ClientSettings.ClientEvents.OnGridCreated = "GetGridObject"
    RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2
    RadGrid1.ClientSettings.AllowColumnsReorder = True
    RadGrid1.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Swap
    RadGrid1.ClientSettings.Selecting.AllowRowSelect = True
    RadGrid1.ClientSettings.Resizing.AllowColumnResize = True
    RadGrid1.ClientSettings.Scrolling.AllowScroll = True
    RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = True
    RadGrid1.ClientSettings.Scrolling.SaveScrollPosition = True
    RadGrid1.ClientSettings.Selecting.AllowRowSelect = True
    RadGrid1.ClientSettings.ClientEvents.OnRowSelected = "rowSelected"
    RadGrid1.MasterTableView.PageSize = 100
    RadGrid1.MasterTableView.AllowMultiColumnSorting = True
    RadGrid1.MasterTableView.DataKeyNames = New String() {"VendorListID"}
    columnCreation("Geography", "Geography", RadGrid1)
    columnCreation("Circ Type", "CirculationTypeDescription", RadGrid1)
    columnCreation("Household", "HouseHold_Count", RadGrid1)
    columnCreation("Total Cov", "TotalCoverage", RadGrid1)
    columnCreation("Day", "Day", RadGrid1)
    columnCreation("Selected", "Selected", RadGrid1)
    columnCreation("Circ", "Circ", RadGrid1)
    columnCreation("Coverage", "Coverage", RadGrid1)
    Me.PlaceHolder1.Controls.Add(RadGrid1)
End Sub

columnCreation
Private Sub columnCreation(ByVal colName As String, ByVal fieldName As String, ByVal oRadGrid As RadGrid)
    If colName = "Circ" Then
        Dim numericColumn = New GridTemplateColumn
        numericColumn.ItemTemplate = New MyEditTemplate(fieldName)
        numericColumn.DataField = fieldName
        numericColumn.HeaderText = colName
        numericColumn.UniqueName = fieldName
        numericColumn.FilterControlWidth = Unit.Pixel(60)
        oRadGrid.MasterTableView.Columns.Add(numericColumn)
   End If
End Sub

MyEditTemplate
Public Class MyEditTemplate
    Implements ITemplate
    Protected textBox As TextBox
    Private colname As String
    Public Sub New(ByVal cName As String)
        colname = cName
    End Sub
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
        textBox = New TextBox()
        textBox.ID = colname
        AddHandler textBox.DataBinding, _
                   AddressOf textBox_DataBinding
  
        container.Controls.Add(textBox)
    End Sub
    Sub textBox_DataBinding(ByVal sender As Object, ByVal e As EventArgs)
        Dim cTextBox As TextBox = DirectCast(sender, TextBox)
        Dim container As GridDataItem = DirectCast(cTextBox.NamingContainer, GridDataItem)
        cTextBox.Text = (DirectCast(container.DataItem, DataRowView))(colname).ToString()
    End Sub
End Class

I use the RadGrid1_NeedDataSource to acquire the information from the database, and then use the RadGrid1_ItemDataBound to set the information up correctly.

RadGrid1_ItemDataBound
Public Sub RadGrid1_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
    If (TypeOf (e.Item) Is GridDataItem) Then
        Dim dataBoundItem As GridDataItem = e.Item
        Dim dataRow As DataRowView = dataBoundItem.DataItem
        Dim index As Integer = dataBoundItem.ItemIndex
        dataBoundItem("Geography").Text = dataBoundItem("Geography").Text.Trim
    End If
End Sub

So, again, what I would like to do is have the user be able to change the value in my textbox. Validate that it is filled in and an integer. Then display an alert() to the user that the information has changed and give them the Geography, Circ Type and Day on the message.

I kind of do something like it with a checkbox template column.

MyTemplate
Public Class MyTemplate
    Implements ITemplate
    Protected boolValue As CheckBox
    Private colname As String
    Public Sub New(ByVal cName As String)
        colname = cName
    End Sub
    Public Sub InstantiateIn(ByVal container As System.Web.UI.Control) Implements ITemplate.InstantiateIn
        boolValue = New CheckBox()
        boolValue.ID = colname
        AddHandler boolValue.DataBinding, _
                   AddressOf boolValue_DataBinding
        boolValue.Enabled = True
        container.Controls.Add(boolValue)
    End Sub
    Sub boolValue_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))(colname)) = 1 Or ((DirectCast(container.DataItem, DataRowView))(colname)) = True Then
            cBox.Checked = True
        Else
            cBox.Checked = False
        End If
    End Sub
End Class
 and then in the RadGrid1_ItemDataBound
dataBoundItem("Selected").Attributes.Add("onClick", "javascript:return fnSelectDayForTelerik(" & index & "," & mode & "," & mintEventID & "," & circType & "," & day & "," & ddlCircSet.SelectedItem.Value & ",'" & mstrSessionID & "'," & Request("PARID") & ",'" & Trim(UCase(Request("TargetGeo"))) & "',0);")
dataBoundItem("Forced").Attributes.Add("onClick", "javascript:return fnSelectDayForTelerik(" & index & "," & mode & "," & mintEventID & "," & circType & "," & day & "," & ddlCircSet.SelectedItem.Value & ",'" & mstrSessionID & "'," & Request("PARID") & ",'" & Trim(UCase(Request("TargetGeo"))) & "',1);")

But if I try the same logic on my Circ dataBoundItem with a onChange or onBlur, nothing fires.
David Kucharski
Top achievements
Rank 1
 answered on 26 Apr 2013
1 answer
71 views
Does the TreeViewList support the ability to drag and drop documents onto the treeviewlist?  I would like to capture the path of the document being dragged, and get the location of the node where it is being dropped.

Please let me know.

Thanks,
Pavlina
Telerik team
 answered on 26 Apr 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?