Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
1.0K+ views
Hi there,
    I have a grid and a button inside the nested view template. What is the way of getting the parent dataitem details in the GridItemCommand event for this button? Have a look at the code below and any help would be higgly appreciated
                            <telerik:RadGrid Skin="Office2007" runat="server" ID="rdGd1" ShowFooter="False"
                                AllowSorting="True" AllowPaging="True"   PageSize="10"
                                GridLines="None">
                                <MasterTableView DataKeyNames="assetNodeID" AutoGenerateColumns="False" Name="MainGrid"
                                    CommandItemDisplay="Top" HierarchyLoadMode="ServerOnDemand">
                                    <CommandItemTemplate>
                                        <asp:Label ID="lblHeaderr" runat="server"></asp:Label>
                                    </CommandItemTemplate>
                                      <Columns>
....
....
.....
  </Columns>
                                    <NestedViewTemplate>
  
         <asp:Panel runat="server" ID="InnerContainer">
      <asp:Button ID="btnView" runat="server" Text="View" CommandName="View" />
 </asp:Panel>
                                    </NestedViewTemplate>
 <ExpandCollapseColumn Visible="True">
                                    </ExpandCollapseColumn>
                                </MasterTableView>
                            </telerik:RadGrid>
  Protected Sub rdGd1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rdGd1.ItemCommand
If e.CommandName = "View" Then
    .... Here I need the current dataItem details of this grid
 End If
  End Sub

Regards
Shafi
L
Top achievements
Rank 1
 answered on 17 Jun 2013
1 answer
151 views
Hi,

I want to find the parent of the parent in a hierarchy grid structure. I have this:
<telerik:RadGrid ID="RadGrid1" runat="server" Width="50%" ShowStatusBar="true" AutoGenerateColumns="False"
            PageSize="50" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True"
            OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource"
            OnPreRender="RadGrid1_PreRender">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView Width="100%" DataKeyNames="ServiceName" AllowMultiColumnSorting="True">
                <DetailTables>
                    <telerik:GridTableView DataKeyNames="MethodName" Name="MethodName" Width="100%">
                        <DetailTables>
                            <telerik:GridTableView DataKeyNames="ParameterName" Name="ParameterName" Width="100%">
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="ParameterName" HeaderText="Parameter Name"
                                        HeaderButtonType="TextButton" DataField="ParameterName">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="ParameterType" HeaderText="Parameter Type"
                                        HeaderButtonType="TextButton" DataField="ParameterType">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridTemplateColumn HeaderText="Parameter Value" UniqueName="ParamWrapper">
                                        <ItemTemplate>
                                            <asp:TextBox runat="server" ID="ParameterValue" Text='<%# DataBinder.Eval(Container.DataItem, "ParameterValue") %>'></asp:TextBox>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
                                </Columns>
                            </telerik:GridTableView>
                        </DetailTables>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="MethodName" HeaderText="Method Name" HeaderButtonType="TextButton"
                                DataField="MethodName" UniqueName="MethodName">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Status">
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="btnMethodStatus" OnClick="btnMethodStatus_OnClick"
                                        Text="-"></asp:Button>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Elapsed time">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblElapsedTime" Text="0">
                                    </asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Last executed on">
                                <ItemTemplate>
                                    <asp:Label runat="server" ID="lblLastTimeExecuted" Text="-">
                                    </asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="ServiceName" HeaderText="Service Name" HeaderButtonType="TextButton"
                        DataField="ServiceName">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderText="Status">
                        <ItemTemplate>
                            <asp:Button runat="server" ID="btnServiceStatus" OnClick="btnServiceStatus_OnClick"
                                Text="-"></asp:Button>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Elapsed time">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblElapsedTime" Text="0">
                            </asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn HeaderText="Last executed on">
                        <ItemTemplate>
                            <asp:Label runat="server" ID="lblLastTimeExecuted" Text="-">
                            </asp:Label>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>

Code behind:
protected void RadGrid1_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "MethodName":
                    {
                        e.DetailTableView.DataSource = Method.GetMethods((string)dataItem.GetDataKeyValue("ServiceName"));
                        break;
                    }
 
                case "ParameterName":
                    {
                         //TODO: Get ParentItem
                        e.DetailTableView.DataSource = Parameter.GetParameters((string)dataItem.GetDataKeyValue("MethodName"), (string)parentItem.GetDataKeyValue("ServiceName"));
                        break;
                    }
            }
        }

In the case "ParamenterName", I need to be able to find the parent of the parent of the EventArgs e. Right now I can easily get the immediate parent, what I need is one step above. 

Thanks in advance,
L
Top achievements
Rank 1
 answered on 17 Jun 2013
2 answers
506 views
I have a support ticket open for this (380752), but I thought I would give the forums a shot as well. The web application I am working on is for an annual review at my company. At the top of the form there is a standard ASP.NET drop down box with a list of names that the person logged into the website manages. They can select the person from the drop down box and on the server side, it will check to see if that use already has an annual review in the database or not. If not, it will display a blank form for the person to fill out and submit to the database.

If there is already one in the database, it will pull the information from the database and populate the many RadTextBoxes and RadNumericTextBoxes I have on the form with the information from the database. This is so they can update it or make changes before the final submission to the employee. That all works fine up to this point. The issue comes in when I try to change a value on the form that was populated with data from the database. If I try to change a rating on one of the RadNumericTextBoxes or change the comments or any change with any of the RadInput controls, when I hit the save button, on the watch list, the values are exactly as they were initially populated from the database and not the changed values I typed in the browser. I am testing this on IE 9.0.7930 and I have also tested it on Firefox 3.6.13 to make sure it was not an IE issue.

Any ideas on what I may be doing wrong?

Thanks.
Kaiser
Top achievements
Rank 1
 answered on 17 Jun 2013
2 answers
45 views
Hi All,
I have an Ajax-ified page with six RadGrids. To avoid duplicate code the grid is in a usercontrol that get's loaded into six panels. The datasource for each grid is handled in the "main" page in code-behind.
Everything's working, except for paging. I believe I need to handle the NeedDataSource event, but I'm unsure where to do this.
Thx in advance for help and/or pointers!
Rgds - M.


Pseudocode (code behind)
// SqlConnection sqlconn = ......
// Dataset, fill etc ...
 
// Findcontrol grid in pnl1
grid1.Datasource = ds.Tables[0];
grid1.DataBind();
 
// Findcontrol grid in pnl2
grid2.Datasource = ds.Tables[1];
grid2.DataBind();
 
//etc


Pseudocode (aspx)
<telerik:RadAjaxManager ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Execute">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnl1" />
                    <telerik:AjaxUpdatedControl ControlID="pnl2" />
                    <telerik:AjaxUpdatedControl ControlID="pnl3" />
                     .......
                  </UpdatedControls>
            </telerik:AjaxSetting>
</telerik:RadAjaxManager>
 
<asp:Panel ID="pnl1" runat="server" Visible="false">
        <uc:Grid ID="Grid1" runat="server" />
</asp:Panel>
<asp:Panel ID="pnl2" runat="server" Visible="false">
        <uc:Grid ID="Grid2" runat="server" />
 </asp:Panel>
...
Marcus
Top achievements
Rank 1
 answered on 17 Jun 2013
3 answers
110 views
HI,

               I have a requirement before inserting an appointment to the scheduler i need to validate it. for that i want to have a serverside call on OnClientAppointmentInserting and then continue with next event OnAppointmentInsert.
currently, i am able to call a server side function on OnClientAppointmentInserting  but the next event i.e. OnAppointmentInsert is not getting fired. May i know how can i handle this?


TIA.

-Teja
Plamen
Telerik team
 answered on 17 Jun 2013
2 answers
140 views

The following code somehow does not display the filtering for columns ID and First Name in the grid. Does it require any code behind or anything for it to show filtering? I just want a very simple filtering for the grid columns.

<telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server"
        <AjaxSettings
            <telerik:AjaxSetting AjaxControlID="RadGrid1"
                <UpdatedControls
                    <telerik:AjaxUpdatedControl  ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                </UpdatedControls
            </telerik:AjaxSetting
            </AjaxSettings
    </telerik:RadAjaxManagerProxy
    
    <telerik:RadAjaxLoadingPanel  ID="RadAjaxLoadingPanel1" runat="server" /> 
    <telerik:RadWindowManager  ID="RadWindowManager1" runat="server"  /> 
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" LoadingPanelID="RadAjaxLoadingPanel1" runat="server"
    
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" PageSize="7"
                 AllowFilteringByColumn="true" AllowSorting="True" AllowPaging="True" ShowStatusBar="True" GridLines="None"  
                 OnNeedDataSource="RadGrid1_NeedDataSource"   
                 OnPreRender="RadGrid1_PreRender"
             <MasterTableView  DataKeyNames="Id" 
                    AllowMultiColumnSorting="True" 
                    TableLayout="Fixed"  CommandItemDisplay="Top"    
                    AllowFilteringByColumn="True"
    
                    <Columns
                         <telerik:GridBoundColumn  ReadOnly="True" HeaderText="ID" DataField="id"
                            SortExpression="id" UniqueName="id" /> 
                        <telerik:GridBoundColumn  HeaderText="First Name" DataField="Name"
                            SortExpression="name" UniqueName="Name" /> 
                    </Columns
                    </MasterTableView
    
                <FilterMenu EnableImageSprites="False" /> 
    
            </telerik:RadGrid
      </telerik:RadAjaxPanel>
Lisa
Top achievements
Rank 1
 answered on 17 Jun 2013
6 answers
281 views
Hi everyone

I want to create RadWindow to help a user enter a value of a textbox. So basically on a form I will have a RadTextBox and a button to show the RadWindow. The RadWindow will have a grid that is filterable with all the options the user can select. When he selects thes value, it needs to close the RadWindow and populate the Textbox with the selected value.

Are there any examples on this?

Thanks
Danail Vasilev
Telerik team
 answered on 17 Jun 2013
6 answers
40 views

Hi, is there a sample anywhere that shows how to read from a SQL source reoccurring events?

I set DataRecurrenceField="ReCurrRule" and DataRecurrenceParentKeyField="Id"

and my demo sql query is:

  Select Id, [Subject] Name ,null stdate,  null enddt, 100
  ,'DTSTART:20131218T180000Z DTEND:20131218T190000Z RRULE:FREQ=WEEKLY;COUNT=10;INTERVAL=5;BYDAY=TH  DTSTART:20131224T100000Z DTEND:20131224T110000Z  RRULE:FREQ=WEEKLY;COUNT=20;INTERVAL=1;BYDAY=TU,TH  EXDATE:20131230T100000Z,20090101T100000Z' ReCurrRule
  from dbo.[Event]

But nothing shows up,
Thank you.

Full Control Definition:

            <telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="Name" DataEndField="enddt" Height="500"
                DataKeyField="Id" DataSourceID="SqlDataSource1" DataStartField="stdate"
                DataSubjectField="Name" DayEndTime="22:00:00" DayStartTime="06:00:00"
                EnableExactTimeRendering="True" MinutesPerRow="15" Skin="Sunset"
                WorkDayEndTime="22:00:00" WorkDayStartTime="06:00:00" NumberOfHoveredRows="1"
                TimelineView-UserSelectable="false" AllowDelete="False" AllowEdit="False" ShowAllDayRow="false" AdvancedForm-Enabled="False" AllowInsert="False" OnClientTimeSlotClick="TS_Click" MultiDayView-ReadOnly="True" MultiDayView-UserSelectable="True" DataRecurrenceField="ReCurrRule" DataRecurrenceParentKeyField="Id">
                <TimelineView UserSelectable="False" />
                <DayView DayEndTime="22:00:00" DayStartTime="06:00:00" />
                <MultiDayView UserSelectable="true" NumberOfDays="7"/>
            </telerik:RadScheduler>
Boyan Dimitrov
Telerik team
 answered on 17 Jun 2013
1 answer
187 views
Hi,

I wanted to take advantage of the lightweight rendermode, but when I set 
RenderMode="Lightweight"
On RadWindow and RadWindow Manager controls, I notice that:

1. I lose my custom icon, it displays the default.
2. Pages that I open in RadWindows that have dynamic page titles (set in codebehind in pre init) do not show the custom title.

When I remove the RenderMode attribute, the issues go away.

Update:
RenderMode="Lightweight" is responsible for the icon not showing up.

 But after removing the RenderMode, I'm still not seeing all my page titles.
That issue is being asked by myself and another user here:
http://www.telerik.com/community/forums/aspnet-ajax/window/title-isn-t-set-from-content.aspx


I am still losing my icon with RenderMode="Lightweight" (I've tried different image formats to no avail)
Marin Bratanov
Telerik team
 answered on 17 Jun 2013
1 answer
153 views
When I add RenderMode="Lightweight" to a RadWindowManager, only the active RadWindow is fully visible.
All other open RadWindows are semi-transparent.

Without the RenderMode="Lightweight", the content of all RadWindows are fully visible.  It's only the Titlebar and "window frame" of non-active windows that become semi-transparent.

I would like to keep RenderMode="Lightweight" but still have content of all windows fully visible.
I see an "Opacity" attribute, but it doesn't seem to do anything.

One of the main reasons to use multiple RadWindows is that users can compare the content of 2 or more windows,or one window has info that is pertinent/related to another window.

This becomes impossible when RenderMode="Lightweight"  because only the active window can be fully seen.

Help!
Marin Bratanov
Telerik team
 answered on 17 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?