Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
143 views
I am currently binding a dynamic datasource to a grid and due to this I can't define my edit template at design time. Using the bottom data row in the attached image (the result set from SQL) I would want to put the row in to edit mode and make BHP_Vehicle a dropdown with a number of options and BodyStyle_Vehicle a dropdown with a different set of options.  I have the datasource in memory so can get the dropdown options based on the column name and rows primary key but I don't know how I can access/control the template when the row is switched in to edit mode.

Further to this, while the row is in edit mode, if a selection is made in the BHP_Vehicle column I would want to rebind the BodyStyle_Vehicle dropdown and vice versa.  Hope this makes sense but does anybody know whether this is possible with the Telerik grid and if so the best way to approach it.

Thanks for your help!
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
97 views
Hello EveryOne,
I have a problem with The RadGrid.In Fact the Caption Text is always "Caption" and Paging are displayed like "GoToPageLabelText
".
Thank's in advance.
Best regards

Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
165 views
I know how to add a right click context menu to the master rows of a radgrid. I need to know how to add a right click context menu the the child hierarchy rows of a master/detals hierachy of a radgrid. Can you assist?

Thanks,

Steve Holdorf
Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
112 views

Hi,

I am trying to auto expand all my grid rows as specified in the telerik demo using expand. So, far I have been unsuccessful after loading the grid and not see any of the row auto expand to the child rows.

In my cs file, I have the code in my .ascx.cs file

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                foidId = Server.UrlDecode(Request.QueryString["FOIA_UID"]);

                if (rgdSubmitterMatrix.MasterTableView.Items.Count > 0)
                {

                    //get MasterTableView's second (index 1) nested view item
                    GridNestedViewItem firstLevelNestedViewItem = (GridNestedViewItem)rgdSubmitterMatrix.MasterTableView.GetItems(GridItemType.NestedView)[0];

                    if (firstLevelNestedViewItem.NestedTableViews.Count() > 0 && firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView).Count() > 0)
                    {
                        //get second nested view item at level 2 of the hierarchy
                        GridNestedViewItem secondLevelNestedViewItem = (GridNestedViewItem)firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView)[0];

                        //get the first item to be expanded
                        GridItem itemToExpand = secondLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.Item)[0];

                        itemToExpand.ExpandHierarchyToTop();
                    }
                    else if (firstLevelNestedViewItem.NestedTableViews.Count() > 0 && firstLevelNestedViewItem.NestedTableViews[0].Items.Count > 0 && firstLevelNestedViewItem.NestedTableViews[0].GetItems(GridItemType.NestedView).Count() == 0)
                    {
                        //get the first item to be expanded
                        GridItem itemToExpand = firstLevelNestedViewItem.NestedTableViews[0].Items[0];

                        itemToExpand.ExpandHierarchyToTop();
                    }
                }
            }
        }

 

In my .ascx file, I have the following telerik jscript and specified the following in the radgrid

ClientSettings-AllowExpandCollapse="true"

 <ClientSettings>
                        <ClientEvents OnHierarchyExpanding="HierarchyExpanding" OnHierarchyExpanded="HierarchyExpanded" OnHierarchyCollapsing="HierarchyCollapsing" OnHierarchyCollapsed="HierarchyCollapsed">
                        </ClientEvents>
                    </ClientSettings>

 

 

  <script type="text/javascript">

      function HierarchyExpanding(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          if (!confirm("Should expand item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "'?")) {
              args.set_cancel(true);
          }
      }

      function HierarchyExpanded(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          alert("Item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "' expanded.");
      }

      function HierarchyCollapsing(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          if (!confirm("Should collapse item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "'?")) {
              args.set_cancel(true);
          }
      }

      function HierarchyCollapsed(sender, args) {
          var firstClientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0];
          alert("Item with " + firstClientDataKeyName + ":'" + args.getDataKeyValue(firstClientDataKeyName) + "' collapsed.");
      }

      function ExpandCollapseFirstMasterTableViewItem() {
          var firstMasterTableViewRow = $find("<%= rgdSubmitterMatrix.MasterTableView.ClientID %>").get_dataItems()[0];
          if (firstMasterTableViewRow.get_expanded()) {
              firstMasterTableViewRow.set_expanded(false);
          }
          else {
              firstMasterTableViewRow.set_expanded(true);
          }
      }

      function ExpandFirstMasterTableViewItem() {
          $find("<%= rgdSubmitterMatrix.MasterTableView.ClientID %>").expandItem(0);
            }

            function CollapseFirstMasterTableViewItem() {
                $find("<%= rgdSubmitterMatrix.MasterTableView.ClientID %>").collapseItem(0);
            }

            function ExpandFirstDetailTableFirstItem() {
                $find("<%= rgdSubmitterMatrix.Items[0].ChildItem.NestedTableViews[0].ClientID %>").expandItem(0);
            }

            function CollapseFirstDetailTableFirstItem() {
                $find("<%= rgdSubmitterMatrix.Items[0].ChildItem.NestedTableViews[0].ClientID %>").collapseItem(0);
            }

  </script>

 

 

 

 <asp:UpdatePanel ID="UpdatePanelMatrix" runat="server" RenderMode="Inline">
            <ContentTemplate>
           <telerik:RadGrid ID="rgdSubmitterMatrix" runat="server" AllowSorting="True" AllowPaging="True" AutoGenerateColumns="False" AllowMultiRowSelection="False" PageSize ="15"
                DataSourceID="odsSubmitterNotice" ClientSettings-AllowExpandCollapse="true" AllowFilteringByColumn="true" GridLines="None" OnItemCreated="rgdSubmitterMatrix_ItemCreated" OnItemCommand="rgdSubmitterMatrix_ItemCommand" OnPreRender="Page_Load" ShowGroupPanel="True" Skin="Outlook" OnItemDataBound="rgdSubmitterMatrix_ItemDataBound">
<%--               <ClientSettings>
                   <Resizing AllowColumnResize="true" AllowRowResize="false" ResizeGridOnColumnResize="false" ClipCellContentOnResize="true" EnableRealTimeResize="false" />
               </ClientSettings>--%>
               <PagerStyle Mode="NumericPages" />
                    <ClientSettings>
                        <ClientEvents OnHierarchyExpanding="HierarchyExpanding" OnHierarchyExpanded="HierarchyExpanded" OnHierarchyCollapsing="HierarchyCollapsing" OnHierarchyCollapsed="HierarchyCollapsed">
                        </ClientEvents>
                    </ClientSettings>

 

Shinu
Top achievements
Rank 2
 answered on 20 Dec 2012
1 answer
194 views
Hi,
I have a radcombobox with OnClientKeyPressing event.User should not enter any special characters.How can i block this.I have used "OnClientKeyPressing " for validating for special characters.This is the JavaScript code
function OnClientKeyPressing() {
            var evtobj = window.event ? event : e
            if ((evtobj.shiftKey) && ((evtobj.keyCode == 188) || (evtobj.keyCode == 190))) {
                alert("Special characters not allowed");
                evtobj.keyCode = 0;
                evtobj.returnValue = false;
                return false;
            }
        }
Eg:-If the user type "vis<" then "<" it should remove.The value should be "vis" instead of "vis<".Now i am getting value as "vis<" and alert is showing.How can i avoid this and data should come starting with "vis" 
Princy
Top achievements
Rank 2
 answered on 20 Dec 2012
0 answers
100 views
Hi,

I have default.aspx page contains RadTabStrip that shows 3 tabs .
So i Added RadPanelBar inside for each RadMultiPage like this ..

<table>
           <tr>
               <td>
                   <telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop"
                       SelectedIndex="0" MultiPageID="RadMultiPage1">
                       <Tabs>
                           <telerik:RadTab Text="Category Summary">
                           </telerik:RadTab>
                           <telerik:RadTab Text="Category Summary Details">
                           </telerik:RadTab>
                           <telerik:RadTab Text="Department Summary Details">
                           </telerik:RadTab>
                       </Tabs>
                   </telerik:RadTabStrip>
                   <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" Height="500px"
                       Width="500px">
                       <telerik:RadPageView runat="server" ID="RadPageView3">
                           <asp:Label ID="Label1" runat="server" Text="Sample page"></asp:Label>
                           <uc:grid ID="radgrid" runat="server" />
                       </telerik:RadPageView>
                       <telerik:RadPageView runat="server" ID="RadPageView1">
                           <telerik:RadPanelBar runat="server" ID="pnlBarCatSummDetails" Width="900" AllowCollapseAllItems="true"
                               ExpandMode="MultipleExpandedItems">
                           </telerik:RadPanelBar>
                       </telerik:RadPageView>
                       <telerik:RadPageView runat="server" ID="RadPageView2">
                           <telerik:RadPanelBar runat="server" ID="pnlBarDeptSummDetails" Width="900" AllowCollapseAllItems="true"
                               ExpandMode="MultipleExpandedItems">
                           </telerik:RadPanelBar>
                       </telerik:RadPageView>
                   </telerik:RadMultiPage>
               </td>
           </tr>
           <tr>
               <td>
               </td>
           </tr>
       </table>

Now I am adding usercontrol to first tab page directly ( refer above code ) and usercontrol is adding  dynamically for 2nd and 3rd tab like this..
Protected Sub RadTabStrip1_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles RadTabStrip1.TabClick
        If RadTabStrip1.SelectedIndex = 0 Then
             ' Already added in aspx page ( not a dynamic one )
        ElseIf RadTabStrip1.SelectedIndex = 1 Then
            Dim i As Integer = 0
            pnlBarCatSummDetails.Items.Clear()
            Do While (i < 2)
 
                Dim dateItem As New RadPanelItem()
                dateItem.Text = "Test page" + i.ToString()
                pnlBarCatSummDetails.Items.Add(dateItem)
 
                Dim control As New RadPanelItem()
                Dim Panel1 As New Panel()
                Dim myControl As Control = LoadControl("CategorySummary.ascx")
                Panel1.Controls.Add(myControl)
                control.Controls.Add(Panel1)
                dateItem.Items.Add(control)
 
                i = i + 1
            Loop
            
        ElseIf RadTabStrip1.SelectedIndex = 2 Then
            Dim i As Integer = 0
            pnlBarDeptSummDetails.Items.Clear()
            Do While (i < 2)
 
                Dim dateItem As New RadPanelItem()
                dateItem.Text = "Dept Test page" + i.ToString()
                pnlBarDeptSummDetails.Items.Add(dateItem)
 
                Dim control As New RadPanelItem()
                Dim Panel1 As New Panel()
                Dim myControl As Control = LoadControl("DepartmentSummary.ascx")
                Panel1.Controls.Add(myControl)
                control.Controls.Add(Panel1)
                dateItem.Items.Add(control)
 
                i = i + 1
            Loop
        End If
    End Sub
 
Each user control have grids and bind using sqldatasource wizard.

Now If I run the application then
First tab showing grid and paging and sorting is working fine. because usercontrol added in aspx page directly.

but usercontrols inside 2nd and 3rd tabs showing grid but sorting and paging not working. ( Cannot see grids in 2nd & 3rd tabs )

Please find the attachment for images..

How can i do solve this problem ?
https://docs.google.com/document/d/1xGOv--xxpzI26_N6M-UFTTnJyipMBIrQHpdMExF4enY/edit

Thanks for your help..
Madhu Palakurthi
Top achievements
Rank 1
 asked on 20 Dec 2012
0 answers
41 views
hi Rad team,

in Mega Drop-Down which is in this link
http://demos.telerik.com/aspnet-ajax/menu/examples/megadropdown/defaultcs.aspx

if i need to reorder the columns under product tab to be right to left
in mega example i saw
<LevelSettings>
    <telerik:SiteMapLevelSetting Level="0">
        <ListLayout RepeatColumns="3" RepeatDirection="Vertical" />
    </telerik:SiteMapLevelSetting>
</LevelSettings>
and i read in help:

If this property is set to RepeatDirection.Vertical, the nodes in the level are displayed in columns loaded from top to bottom, then left to right, until all nodes are rendered.

If this property is set to RepeatDirection.Horizontal, the nodes in the level are displayed in rows loaded from left to right, then top to bottom, until all nodes are rendered.

what actually i need is
columns loaded from top to bottom, then right to left, until all nodes are rendered
if that possible ?

Thanks

Ahmed
Top achievements
Rank 1
 asked on 19 Dec 2012
2 answers
90 views
Hi there,

It is easy to highlight an entire row using radgrid rowmouseover event, but I need to highlight a radgrid cell on rowmouseover, not the entire row. Anyone suggestions would be appreciated. 

Thanks,
Meng 
Meng
Top achievements
Rank 1
 answered on 19 Dec 2012
3 answers
110 views
I have a calendar where I only allow the user to select one day. Here's the code I have for that.

Dim selDate
        If (e.SelectedDates.Count <> 0) Then
            selDate = e.SelectedDates(e.SelectedDates.Count - 1).Date
            calDay.SelectedDate = selDate
            litDaySpec.Text = clsData.displayReservationsForADay(calDay.SelectedDate)
            Dim dateDate As New DateTime(calDay.SelectedDate.Year, calDay.SelectedDate.Month, calDay.SelectedDate.Day, 12, 0, 0)
            If getDST(calDay.SelectedDate) Then
                'If (TimeZone.CurrentTimeZone.IsDaylightSavingTime(dateDate)) Then
                lblTime.Text = "6:00"
            Else
                lblTime.Text = "5:00"
            End If
        Else

The only problem with this is, if they have a date selected, and click that same date. I.e. 12/18/2012 is selected and they click 12/18/2012 again, it deselects that date so not date is selected. Is there a way I can make it keep that 12/18 selected if they click it and it's already been selected?





Kevin
Top achievements
Rank 2
 answered on 19 Dec 2012
2 answers
98 views
Hi,

I have an aspx page (Page1.aspx) with RadwindowManager and one of the window inside RadWindowManager1 displays Page2.aspx.

On Page2.aspx , there is another Child RadwindowManager2, there are some buttons  inside contentemplate of this RadWindowmanager2.
On clicking these buttons inside Radwindow in radwindowManager2, I would like to update Page1.aspx.
How can I implement this logic?

Using "GetCurrentRadWindow().BrowserWindow.ZoomToSelectedAppointment(apptID);" helped me update page1.aspx from Radwindowmanager1, but  this does not work on Radwindow with contentemplate.



    function GetCurrentRadWindow() {
       var oWindow = null;
       if (window.radWindow) oWindow = window.radWindow;
       else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
       return oWindow;
   }



Thanks for help.
Prava
Prava kafle
Top achievements
Rank 1
 answered on 19 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?