Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
753 views

Hi,

Environment: VS 2008 SP1, RadControls for ASP.NET AJAX Q1 2010 NET35.

I have a Radgrid with 2 Independant Detail Tables. My questions are:

1) Is it possible to Hide/Show Detail Tables from Master Table Edit forms Link Button Onclick Events (LinkButton5 and LinkButton6 are in this page)?

2) In Initial Page load event, show Detail Table (Name="Detail") by default but hide Detail Table1 (Name="Detail1") .

3) Can the currently active (unhiden) Detail Table name be displayed in a Master Table label after link buttons onclick event as well as on initial page load event?
 

Below are my codes. But Onlclick events of Link Buttons are not working.

 

Thanks

gc_0620

______________ 

<%-- Beginning Block of Rad Grid --%>                              
<telerik:RadGrid ID="RadGrid1" runat="server">
  
<%-- Beginning Block of Master Table --%>                
<MasterTableView DataKeyNames="PersonTableID" Name="Master" Font-Size="11px" DataSourceID="SqlDataSource3"
                    AllowFilteringByColumn="true" CommandItemDisplay="Top">
                     <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                      
                        <%-- Beginning Block of Detail Table --%>                
                    <DetailTables>
                        <telerik:GridTableView runat="server" DataSourceID="SqlDataSource4" DataKeyNames="JobPersonID"
                            ShowHeader="true" Width="100%" Name="Detail" AllowAutomaticDeletes="true" ClientDataKeyNames "JobPersonID"
                              
                           
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="PersonId" MasterKeyField="PersonTableID" />
                            </ParentTableRelation>
                              
                            <Columns>
                             '''
                             '''
                  
                            </Columns>
                            <EditFormSettings EditFormType="Template" FormCaptionStyle-CssClass="form-controls">
                                <FormCaptionStyle CssClass="form-controls"></FormCaptionStyle>
                                <FormTemplate>
                                    '''
                                    '''
                                </FormTemplate>
                            </EditFormSettings>
                        </telerik:GridTableView>
                         
                    </DetailTables>   
                    <%-- Ending Block of Detail Table --%>  
  
                    <%-- Beginning Block of Detail Table1 --%>                              
                   <DetailTables>
                        <telerik:GridTableView runat="server" DataSourceID="SqlDataSource5" DataKeyNames="JobPersonID"
                            ShowHeader="true" Width="100%" Name="Detail1" AllowAutomaticDeletes="true" ClientDataKeyNames "JobPerson_SecondaryID"
                              
                           
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="PersonId" MasterKeyField="PersonTableID" />
                            </ParentTableRelation>
                              
                              
                            <Columns>
                             '''
                             '''
                                 
                            </Columns>
                            <EditFormSettings EditFormType="Template" FormCaptionStyle-CssClass="form-controls">
                                <FormCaptionStyle CssClass="form-controls"></FormCaptionStyle>
                                <FormTemplate>
                                    '''
                                    '''
                                </FormTemplate>
                            </EditFormSettings>
                        </telerik:GridTableView>
                         
                    </DetailTables>
                    <%-- Ending Block of Detail Table1 --%>                               
                      
                    <ExpandCollapseColumn Visible="True">
                    </ExpandCollapseColumn>
                    <Columns>
                    '''
                    '''
                    </Columns>
            <%-- Beginning Block of Master Table Edit Forms --%>                              
                    <EditFormSettings EditFormType="Template">
                        <FormTemplate>
                            <table id="Table2" class="form-controls" cellspacing="2" cellpadding="1" width="100%"
                                border="0" rules="none" style="border-collapse: collapse;background:#DCDCDC;">
                                <tr>
                                      
                                      
                                    <td>
                                    Show Hide Detail Forms:
                                    </td>
                                   <td>
                                           
                                         <asp:LinkButton ID="LinkButton5" onclick = "HideDetail_ShowDetail1_Click"  runat="server">Hide Detail but Show Detail1</asp:LinkButton>
                                          <asp:LinkButton ID="LinkButton5" onclick = "HideDetail1_ShowDetail_Click"  runat="server">Hide Detail1 but Show Detail</asp:LinkButton>
  
  
  
                                    </td>
                                   </tr>
                            </table>
                        </FormTemplate>
                    </EditFormSettings>
                    <%-- Ending Block of Master Table Edit Forms --%>                              
                </MasterTableView>
            <%-- Ending Block of Master Table --%>                              
                <ClientSettings>
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
            </telerik:RadGrid>
<%-- Ending Block of Rad Grid --%>                              
___________
  
protected void HideDetail_ShowDetail1_Click(object sender, System.EventArgs e)
    {
         
        RadGrid1.MasterTableView.DetailTables[0].Visible = false;
        RadGrid1.MasterTableView.DetailTables[1].Visible = true;
    }
  
protected void HideDetail1_ShowDetail_Click(object sender, System.EventArgs e)
    {
         
        RadGrid1.MasterTableView.DetailTables[1].Visible = false;
        RadGrid1.MasterTableView.DetailTables[0].Visible = true;
    }

 

Jittu
Top achievements
Rank 1
 answered on 10 Sep 2012
2 answers
111 views
I went by this example http://demos.telerik.com/aspnet-ajax/ajax/examples/common/ajaxifytimer/defaultcs.aspx to create a timer that would automatically refresh my radgrid. What I wanting to do is not have it update if the user is in the middle of updating a row. What is the best way to go about doing this?

Also, is there a way make it so that the page isn't entirely rerendered? If I used an updatepanel, only the content inside was repainted. It looks like the entire page is getting rerendered. 
DuelingCats
Top achievements
Rank 2
 answered on 10 Sep 2012
3 answers
519 views
Hi,

We are using a RadDatePicker in our application, we just want to handle the RadDatePicker enter key press event . We have used  DateInput-ClientEvents-OnKeyPress but this method does not fire on enter key press , so we tried with onkeydown event but this event does not return the values entered in the raddatepicker textbox (if date is manually entered ) also the Telerik in built Date validations are also not working when onkeydown  method is used. We just want to bind a grid on Datedatepicked textbox enter key press event. Please help us in this.


Thanks,
Eyup
Telerik team
 answered on 10 Sep 2012
3 answers
254 views
I have a RadGrid with some columns using filtering.  The filters are RadComboBox and I need to pre-select a value in the combo box when the page loads using a QueryString value I am passing in.  Here is my ASPX code.  Please help, how do I get my filter preselected to the value I am passing in.

QueryString:
Request.QueryString["AssigneeFullName"]

ASPX:
<telerik:GridTemplateColumn DataField="AssigneeFullName" HeaderText="Assignee" UniqueName="AssigneeFullName"
SortExpression="AssigneeFullName" HeaderStyle-Width="130px">
<ItemTemplate>
<asp:Label ID="lblAssigneeFullName" runat="server" Text='<%#Eval("AssigneeFullName")%>'></asp:Label>
</ItemTemplate>
<HeaderStyle Font-Bold="True" Width="130px" HorizontalAlign="Center" Font-Names="Arial" />
<FilterTemplate>
<telerik:RadComboBox ID="RadComboBoxTitle" DataTextField="FullName" DataValueField="FullName"
OnSelectedIndexChanged="RadComboAssignee_SelectedIndexChanged" AppendDataBoundItems="true"
SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AssigneeFullName").CurrentFilterValue %>'
runat="server" OnClientSelectedIndexChanged="AssigneeIndexChanged" Width="120px"
DataSource="<%# ComboBoxAssignees() %>">
<Items>
<telerik:RadComboBoxItem Text="View All" Value="" />
</Items>
</telerik:RadComboBox>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">

<script type="text/javascript">
function AssigneeIndexChanged(sender, args) {
var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
tableView.filter("AssigneeFullName", args.get_item().get_value(), "EqualTo");
}
</script>

</telerik:RadScriptBlock>
</FilterTemplate>
</telerik:GridTemplateColumn>
Eyup
Telerik team
 answered on 10 Sep 2012
3 answers
80 views
Hello telerik team,

selecting a row by code (JavaScript or code behind) does not fire the event SelectedIndexChanged.
The event is fired by clicking the row with the mouse, but not by code.

Example:
var mt = findGrid().get_masterTableView();
if(mt) {
  mt.clearSelectedItems();
  mt.selectItem(mt.get_dataItems()[1].get_element());
}

The item is selected but the event isn't fired.
EnablePostBackOnRowClick is enabled.

Greetings
Hubert
John
Top achievements
Rank 1
 answered on 10 Sep 2012
7 answers
462 views
Hello,

Could you please help me to find some examples like treeview nodes & context menu with edit,delete,add feature on runtime binding ?
something like -

http://www.telerik.com/help/aspnet-ajax/treeview-context-menu-runtime.html



thank you.

- darshan
Plamen
Telerik team
 answered on 10 Sep 2012
1 answer
153 views
Hello,

I have read the document in http://demos.telerik.com/aspnet-ajax/tabstrip/examples/applicationscenarios/dynamicpageview/defaultcs.aspx.

I am building a radmultipage, with dynamic number of tabs. (The number of tabs and its title are loading from the database)

Following the instruction, I have success to build the page. But I find I cannot pass values from the master page to the control page. Is there any method to pass some value to the user control page?

For example, I create a dynamic multipage with 3 tabs, named "John", "David" and "Phoenix". I want one of the label in the control page have text XX's page. (i.e. When I click tab "John", it display "John's page", and when I click tab "Phoenix", it display "Phoenix's page").


Kev
Nencho
Telerik team
 answered on 10 Sep 2012
1 answer
67 views
Hello ,
I have a asp checkbox in header row of rad grid. I have set focus on it when press tab. But it doesn't get highlighted in firefox and IE. Is there any possible way to do this.

Thanks
Abhi
Eyup
Telerik team
 answered on 10 Sep 2012
9 answers
274 views
Hi,
I am using a ValidationSummary to display the RadCaptcha error messages along with the other controls on my form.  But, when I set the ErrorMessage property of RadCaptcha, the error message also always displays right above the RadCaptcha control on the page.  Is there a way to turn that error message off so it only displays in the ValidationSummary at the top of my page and not right above the component itself?  I'd rather not show 2 identical error messages on the page in different places.

Thanks,
Tim
Ryan
Top achievements
Rank 1
 answered on 10 Sep 2012
3 answers
89 views
Hi,

I want to change the order of a checked button client-side. This works, but after moving the button, it loses it's text.

This is my code:
moveButtonRight: function () {
      var toolbar = this.get_radToolBar();
      toolbar.trackChanges();
      var button = this._getSelectedButton();
      var index = toolbar.get_items().indexOf(button);
      if (index < toolbar.get_items().get_count() - 1) {
         toolbar.get_items().removeAt(index);
         toolbar.get_items().insert(index + 1, button);
      }
      toolbar.commitChanges();
   },
   _getSelectedButton: function () {
      var toolbar = this.get_radToolBar();
      var itemCount = toolbar.get_items().get_count();
 
      for (var i = 0; i < itemCount; i++) {
         var item = toolbar.get_items().getItem(i);
         if (item.constructor.getName() == "Telerik.Web.UI.RadToolBarButton" && item.get_checked()) {
            return item;
         }
      }
 
      return null;
   }

When I change the _getSelectedButton function so that I call item.get_text() before returning it, it works fine:

_getSelectedButton: function () {
      var toolbar = this.get_radToolBar();
      var itemCount = toolbar.get_items().get_count();
 
      for (var i = 0; i < itemCount; i++) {
         var item = toolbar.get_items().getItem(i);
         if (item.constructor.getName() == "Telerik.Web.UI.RadToolBarButton" && item.get_checked()) {
            item.get_text();
            return item;
         }
      }
 
      return null;
   }

Is this a bug or what else could cause this?

Thanks!
Kate
Telerik team
 answered on 10 Sep 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?