Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
127 views
I have three master /detail RadGrids like:

--1
----2
------3

I am trying to ensure two scenarios:

How can I make sure the appropriate rows are selected and the correct child data loaded for when the page loads and the user clicks a row in any grid?

I tried accessing the SelectedItems during Page_PreRender but only succeeded in selecting the first rows on page load, not when the user clicks a row. I tried the solution found on this site to always select a row but the code did not work for me.

Richard

Here is some source:

aspx
        <telerik:RadGrid 
            AllowAutomaticDeletes="true" 
            AllowAutomaticInserts="true" 
            AllowAutomaticUpdates="true" 
            AutoGenerateEditColumn="true" 
            DataSourceID="FirstDataSource" 
            Height="380" 
            ID="FirstGrid" 
            OnDeleteCommand="Grid_OnCommand" 
            OnInsertCommand="Grid_OnCommand" 
            OnItemDeleted="Grid_OnItemDeleted" 
            OnItemInserted="Grid_OnItemInserted" 
            OnItemUpdated="Grid_OnItemUpdated" 
            OnUpdateCommand="Grid_OnCommand" 
            runat="server">
            <MasterTableView 
                DataKeyNames="Id">
                <Columns>
                    <telerik:GridBoundColumn 
                        DataField="Id" 
                        DataType="System.Int32" 
                        HeaderText="System Id" 
                        ReadOnly="True" 
                        UniqueName="FirstId">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn 
                        ButtonType="LinkButton" 
                        CommandName="Delete" 
                        ConfirmText="Delete this record?\n\nThis action cannot be undone." 
                        Text="Delete" 
                        UniqueName="DeleteFirst">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings 
                AllowKeyboardNavigation="true" 
                EnablePostBackOnRowClick="true">
                <Selecting AllowRowSelect="true" />
                <Scrolling 
                    AllowScroll="true" 
                    SaveScrollPosition="true" 
                    UseStaticHeaders="true" />
            </ClientSettings>
        </telerik:RadGrid>
  
        <telerik:RadGrid 
            AllowAutomaticDeletes="true" 
            AllowAutomaticInserts="true" 
            AllowAutomaticUpdates="true" 
            AutoGenerateEditColumn="true" 
            DataSourceID="SecondDataSource" 
            Height="380" 
            ID="SecondGrid" 
            OnDeleteCommand="Grid_OnCommand" 
            OnInsertCommand="Grid_OnCommand" 
            OnItemDeleted="Grid_OnItemDeleted" 
            OnItemInserted="Grid_OnItemInserted" 
            OnItemUpdated="Grid_OnItemUpdated" 
            OnUpdateCommand="Grid_OnCommand" 
            runat="server">
            <MasterTableView 
                DataKeyNames="Id">
                <Columns>
                    <telerik:GridBoundColumn 
                        DataField="Id" 
                        DataType="System.Int32" 
                        HeaderText="System Id" 
                        ReadOnly="True" 
                        UniqueName="SecondId">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="FirstId" 
                        DataType="System.Int32" 
                        ForceExtractValue="Always" 
                        ReadOnly="True" 
                        UniqueName="FirstId" 
                        Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn 
                        ButtonType="LinkButton" 
                        CommandName="Delete" 
                        ConfirmText="Delete this record?\n\nThis action cannot be undone." 
                        Text="Delete" 
                        UniqueName="DeleteSecond">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings 
                AllowKeyboardNavigation="true" 
                EnablePostBackOnRowClick="true">
                <Selecting AllowRowSelect="true" />
                <Scrolling 
                    AllowScroll="true" 
                    SaveScrollPosition="true" 
                    UseStaticHeaders="true" />
            </ClientSettings>
        </telerik:RadGrid>
  
        <telerik:RadGrid 
            AllowAutomaticDeletes="true" 
            AllowAutomaticInserts="true" 
            AllowAutomaticUpdates="true" 
            AutoGenerateEditColumn="true" 
            DataSourceID="ThirdDataSource" 
            Height="380" 
            ID="ThirdGrid" 
            OnDeleteCommand="Grid_OnCommand" 
            OnInsertCommand="Grid_OnCommand" 
            OnItemDeleted="Grid_OnItemDeleted" 
            OnItemInserted="Grid_OnItemInserted" 
            OnItemUpdated="Grid_OnItemUpdated" 
            OnUpdateCommand="Grid_OnCommand" 
            runat="server">
            <MasterTableView 
                DataKeyNames="Id">
                <Columns>
                    <telerik:GridBoundColumn 
                        DataField="Id" 
                        DataType="System.Int32" 
                        HeaderText="System Id" 
                        ReadOnly="True" 
                        UniqueName="ThirdId">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn 
                        DataField="SecondId" 
                        DataType="System.Int32" 
                        ForceExtractValue="Always" 
                        ReadOnly="True" 
                        UniqueName="SecondId" 
                        Visible="false">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn 
                        ButtonType="LinkButton" 
                        CommandName="Delete" 
                        ConfirmText="Delete this record?\n\nThis action cannot be undone." 
                        Text="Delete" 
                        UniqueName="DeleteThird">
                    </telerik:GridButtonColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings>
                <Scrolling 
                    AllowScroll="true" 
                    SaveScrollPosition="true" 
                    UseStaticHeaders="true" />
            </ClientSettings>
        </telerik:RadGrid>
  
    </telerik:RadPane>
</telerik:RadSplitter>
  
<asp:EntityDataSource 
    ConnectionString="name=Entities" 
    DefaultContainerName="Entities" 
    EnableDelete="True" 
    EnableFlattening="False" 
    EnableInsert="True" 
    EnableUpdate="True"  
    EntitySetName="Firsts" 
    EntityTypeFilter="First" 
    ID="FirstDataSource" 
    runat="server">
</asp:EntityDataSource>
  
<asp:EntityDataSource 
    ConnectionString="name=Entities" 
    DefaultContainerName="Entities" 
    EnableDelete="True" 
    EnableFlattening="False" 
    EnableInsert="True" 
    EnableUpdate="True"  
    EntitySetName="Seconds" 
    EntityTypeFilter="Second" 
    ID="SecondDataSource" 
    runat="server" 
    Where="it.[FirstId] = @FirstId">
    <WhereParameters>  
        <asp:ControlParameter ControlID="FirstGrid" DefaultValue="0" Name="FirstId" PropertyName="SelectedValue" Type="Int32" />  
    </WhereParameters>  
</asp:EntityDataSource>
  
<asp:EntityDataSource 
    ConnectionString="name=Entities" 
    DefaultContainerName="Entities" 
    EnableDelete="True" 
    EnableFlattening="False" 
    EnableInsert="True" 
    EnableUpdate="True"  
    EntitySetName="Thirds" 
    EntityTypeFilter="Third" 
    ID="ThirdDataSource" 
    runat="server"
    Where="it.[SecondId] = @SecondId">
    <WhereParameters>  
        <asp:ControlParameter ControlID="SecondGrid" DefaultValue="0" Name="SecondId" PropertyName="SelectedValue" Type="Int32" />  
    </WhereParameters
</asp:EntityDataSource>
Mira
Telerik team
 answered on 18 Aug 2011
2 answers
82 views
I saw this article: http://www.telerik.com/help/aspnet-ajax/grid-align-columns-in-hierarchy.html

but can't make it work to align the columns; have you got any code samples with Visa skin?

Thanks,
Pooya
Top achievements
Rank 1
 answered on 18 Aug 2011
7 answers
125 views
Hi all,

I am using RadGrid with NestedViewTemplate is another RadGrid for showing Master - Detail data. As the default, when you click on the icon in the first column to show the detail view.

Could I change this by clicking on another column (I don't want to use the first column and of course its icon).
Thank you,
Phuc PHAM
Phuc
Top achievements
Rank 1
 answered on 18 Aug 2011
1 answer
63 views
Dear Telerik Team,

I would like to maintain parent grid row selected colour after double click parent grid and appears popup window.

Thanks in advance,
Phyu Sin.
Princy
Top achievements
Rank 2
 answered on 18 Aug 2011
7 answers
250 views
hello

i am currently replacing some buttons with the radbutton.
for buttons and linkbuttons i was setting the "onclick" attribute to call a JS-function which opens a popup after checking if it isn't already open which should be avoided when using radbutton.
so i adapted the code to use the radbuttons OnClientClicking property to

"function(sender,args){" + javaScriptCall + "}";

where javaScriptCall calls the JS-function which returns a window:

top.Popup1 = OpenWindowWithCheck(top.Popup1, 'url', 'errormessage','Popup1')

and here is the function:

function OpenWindowWithCheck(Window, PagePath, ErrorMessage, WindowName)
{
    if (Window == null || Window.closed) {
        Window = window.open(PagePath, WindowName);
    }
    else {
        if (confirm(ErrorMessage))
        {
            Window.close();
            Window = window.open(PagePath, WindowName);
        }
        else
        {
            Window.focus();
        }
    }
    return Window;
}

This works well except that i get a popup-blocker message by IE9 now.
How can i avoid this popup-message or is there another way to call my JS-function with radbutton?


Slav
Telerik team
 answered on 18 Aug 2011
6 answers
130 views
Hi all,

I am using a combobox with its items are checkboxes. When a item is checked/unchecked another combobox will be filtered data. So what is the EventName of this Action for declaring UpdatedControls as below

<telerik:AjaxSetting AjaxControlID="cmbCheckBox" EventName="?">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cmbFiltered" />
                </UpdatedControls>                
            </telerik:AjaxSetting>

Thanks for your support.
Phuc
Top achievements
Rank 1
 answered on 18 Aug 2011
3 answers
157 views
I've got 3 textboxes and an InputManager that sets the EmptyMessages of these textboxes. On initial page load, the empty messages are displayed fine, however on an Ajax postback of a radcombobox, these empty messages disappear and leave the textboxes blank.

Why is this happening? Thanks.
Iana Tsolova
Telerik team
 answered on 18 Aug 2011
1 answer
96 views
hi,

I have been searching this for many days. How to populate 2nd radgrid based on the selected row of 1st radgrid. I dont want postback to happen as I will be doing many other functionalities on 1st grid like doubleclick to open modal window sort, filter etc.

Please can anyone help me with sample code

Thanks in advance.
Princy
Top achievements
Rank 2
 answered on 18 Aug 2011
1 answer
98 views
Hi,

I have implemented a master child rad grid , where the child data for a particular row gets loaded only when user clicks on the uncollapse icon next to the mater data for a particular row.

Now when I am doing an export to excel via ItemCommand, i found that it also tries to load the child data by calling Childgrid_NeedDataSource before doing an export. Is there a way I can stop from doing that and only export the master data?

Note: I am having this issue only when I set IgnorePaging to true. Its works fine with IgnorePaging to false.

Any suggestions

-Rajesh
Mira
Telerik team
 answered on 18 Aug 2011
4 answers
175 views
Hi,
I'm facing an issue with RadScheduler.

I'm in WeekView, with ShowAllDayRow property set at true.
What I have to do to show ONLY the all day row, hiding ALL the hours row? setting DayStartTime same as DayEndTime doesn't work.

thanks in advance

Leo
David
Top achievements
Rank 1
 answered on 18 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?