Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
165 views
Hi, 
  

  I am using hierarchy grid. It's one master table two details table. I need to align same column width in this three table. I had set both column for header style and itemstyle width. But it not fixed. when i am click expand button the master table width is automatically changed.  Please check the code and Screen shot, any one know the result let me know.

<telerik:RadGrid ID="RadGrid1"   
    OnItemCreated="RadGrid1_ItemCreated"   
    OnItemCommand="RadGrid1_ItemCommand"   
    OnDetailTableDataBind="RadGrid1_DetailTableDataBind" 
    OnItemDataBound="RadGrid1_ItemDataBound"   
    OnPreRender="RadGrid1_PreRender"    
    OnDeleteCommand="RadGrid1_DeleteCommand"    
    OnNeedDataSource="RadGrid1_NeedDataSource" 
    ShowStatusBar="true"   
    AutoGenerateColumns="False" PageSize="3" AllowSorting="True" AllowMultiRowSelection="False" 
    AllowPaging="True" GridLines="None" 
    HeaderStyle-CssClass="GridHeader_Outlook" AlternatingItemStyle-BackColor="#EEEEEE" 
    SelectedItemStyle-CssClass="SelectedItem" BorderColor="#BEBEBE" 
    runat="server" > 
    <ClientSettings>    
        <ClientEvents OnColumnResizing="ResizeAllColumns" />      
    </ClientSettings>    
    <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" /> 
    <SortingSettings  EnableSkinSortStyles="false" /> 
    <MasterTableView  Name="Master"   
        ClientDataKeyNames="ROOMID,TRANSLATEDCODE,ROOMTRANSLATEDID,ROOMNAME,ROOMSCORE,ROOMVALIDTILL" 
        DataKeyNames="ROOMNAME,ROOMID,LOCATIONID,TRANSLATEDCODE,ROOMTRANSLATEDID,ROOMSCORE,ROOMVALIDTILL" 
        AllowMultiColumnSorting="True"   
        Width="100%">   
        <DetailTables> 
            <telerik:GridTableView Width="100%" BorderColor="#BEBEBE"   
                runat="server" Name="Detail1" DataKeyNames="ZONENAME,TRANSLATEDCODE,ZONETRANSLATEDID, ZONEID,ROOMID,ZONESCORE,ZONEVALIDTILL" 
                ClientDataKeyNames="ZONENAME,ZONETRANSLATEDID,TRANSLATEDCODE, ZONEID,ROOMID,ZONESCORE,ZONEVALIDTILL" > 
                <PagerStyle Visible="false" /> 
                <ParentTableRelation> 
                    <telerik:GridRelationFields DetailKeyField="ROOMID" MasterKeyField="ROOMID" /> 
                </ParentTableRelation> 
                <DetailTables> 
                    <telerik:GridTableView  Width="100%" runat="server" BorderColor="#BEBEBE"   
                        Name="Detail2" DataKeyNames="ELEMENTNAME,TRANSLATEDCODE, ZONEID,ELEMENTID,ELEMENTTRANSLATEDID,ELEMENTSCORE,ELEMENTVALIDTILL" 
                        ClientDataKeyNames="ELEMENTNAME,TRANSLATEDCODE,ELEMENTTRANSLATEDID, ZONEID,ELEMENTID,ELEMENTSCORE,ELEMENTVALIDTILL">  
                       <ParentTableRelation> 
                            <telerik:GridRelationFields DetailKeyField="ZONEID" MasterKeyField="ZONEID" /> 
                       </ParentTableRelation> 
                       <PagerStyle Visible="false" /> 
                        <Columns> 
                            <telerik:GridBoundColumn HeaderText="ElementID" DataField="ELEMENTID" UniqueName="ELEMENTID"   
                                    SortExpression="ELEMENTID" ReadOnly="true" Visible="false">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn HeaderText="Description" DataField="ELEMENTNAME" UniqueName="ELEMENTNAME"   
                                    SortExpression="ELEMENTNAME" ReadOnly="true">  
                            </telerik:GridBoundColumn> 
                              
                            <telerik:GridTemplateColumn> 
                                <HeaderTemplate> 
                                    <asp:Label ID="lblHeadElementRemarks" runat="server" Text="Remarks"></asp:Label> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                    <asp:TextBox ID="radTxtRemarks" runat="server" ></asp:TextBox> 
                                </ItemTemplate> 
                                 <HeaderStyle Width="150px" /> 
                                <ItemStyle Width="150px" /> 
                            </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Left" UniqueName="CbColumn" > 
                                <HeaderStyle HorizontalAlign="Center" /> 
                                <ItemTemplate > 
                                 
                                </ItemTemplate> 
                                 <HeaderStyle Width="150px" /> 
                                <ItemStyle Width="150px" /> 
                            </telerik:GridTemplateColumn> 
                              
                            <telerik:GridTemplateColumn > 
                                <HeaderStyle HorizontalAlign="Center"/>  
                                <HeaderTemplate> 
                                     <asp:Label ID="lblHeaderElementScore" Text="Score" runat="server"></asp:Label> 
                                </HeaderTemplate> 
                                <ItemTemplate> 
                                     <asp:Label ID="lblElementScore"  runat="server" Text="0"   ></asp:Label>%  
                                </ItemTemplate> 
                                 <HeaderStyle Width="40px" /> 
                                <ItemStyle Width="40px" /> 
                            </telerik:GridTemplateColumn> 
                        </Columns> 
                    </telerik:GridTableView> 
                </DetailTables> 
                <Columns> 
                    <telerik:GridBoundColumn HeaderText="ZoneID" DataField="ZONEID" UniqueName="ZONEID"   
                                    SortExpression="ZONEID" ReadOnly="true" Visible="false">  
                            </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn HeaderText="Description" DataField="ZONENAME" UniqueName="ZONENAME"   
                            SortExpression="ZONENAME" ReadOnly="true">  
                    </telerik:GridBoundColumn> 
                    <telerik:GridTemplateColumn> 
                        <HeaderTemplate> 
                            <asp:Label ID="lblHeadZoneRemarks" runat="server" Text="Remarks"></asp:Label> 
                        </HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblZoneRemarks" runat="server"></asp:Label> 
                        </ItemTemplate> 
                        <HeaderStyle Width="150px" /> 
                        <ItemStyle Width="150px" /> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn> 
                        <HeaderTemplate> 
                            <asp:Label ID="lblHeadZoneRating" runat="server" Text="Rating"></asp:Label> 
                        </HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblZoneRating" runat="server"></asp:Label> 
                        </ItemTemplate> 
                        <HeaderStyle Width="150px" /> 
                        <ItemStyle Width="150px" /> 
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn  UniqueName="HeaderZoneScore">  
                        <HeaderStyle HorizontalAlign="Center"/>  
                        <HeaderTemplate> 
                             <asp:Label ID="lblHeaderZoneScore" Text="Score" runat="server"></asp:Label> 
                        </HeaderTemplate> 
                        <ItemTemplate> 
                             <asp:Label ID="lblZonesScore" runat="server" Text="0"  ></asp:Label>%  
                        </ItemTemplate> 
                        <HeaderStyle Width="40px" /> 
                        <ItemStyle Width="40px" /> 
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </telerik:GridTableView> 
        </DetailTables> 
        <Columns> 
            <telerik:GridBoundColumn HeaderText="RoomID" DataField="ROOMID" UniqueName="ROOMID"   
                                    SortExpression="ROOMID" ReadOnly="true" Visible="false">  
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn HeaderText="Description" DataField="ROOMNAME" UniqueName="ROOMNAME"   
                    SortExpression="ROOMNAME" ReadOnly="true">  
      
            </telerik:GridBoundColumn> 
            <telerik:GridTemplateColumn> 
                <HeaderTemplate> 
                    <asp:Label ID="lblHeadRoomRemarks" runat="server" Text="Remarks"></asp:Label> 
                </HeaderTemplate> 
                <ItemTemplate> 
                    <asp:Label ID="lblRoomRemarks" runat="server"></asp:Label> 
                </ItemTemplate> 
                <HeaderStyle Width="150px" /> 
                <ItemStyle Width="150px" /> 
            </telerik:GridTemplateColumn> 
            <telerik:GridTemplateColumn> 
                <HeaderTemplate> 
                    <asp:Label ID="lblHeadRoomRating" runat="server" Text="Rating"></asp:Label> 
                </HeaderTemplate> 
                <ItemTemplate> 
                    <asp:Label ID="lblRoomRating" runat="server"></asp:Label> 
                </ItemTemplate> 
                <HeaderStyle Width="150px" /> 
                <ItemStyle Width="150px" /> 
            </telerik:GridTemplateColumn> 
             
            <telerik:GridTemplateColumn  UniqueName="HeaderRoomScore">  
                <HeaderStyle HorizontalAlign="Center"/>  
                <HeaderTemplate> 
                     <asp:Label ID="lblHeaderScore" Text="Score" runat="server"></asp:Label> 
                </HeaderTemplate> 
                <ItemTemplate> 
                    <asp:Label ID="lblRoomScore" Text="0"   runat="server"></asp:Label>%  
                </ItemTemplate> 
                <HeaderStyle Width="40px" /> 
                <ItemStyle Width="40px" /> 
            </telerik:GridTemplateColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

Kumar Ramasany
Top achievements
Rank 1
 answered on 04 Mar 2010
1 answer
163 views
Hi,
I have my RadAjaxPanel on top of my page. When the page is post pack, the RadAjaxLoadingPanel is shown at the top of the page (at the center of the RadAjaxPanel).
I would like to have the RadAjaxLoadingPanel shown at the center of the page instead of center of RadAjaxPanel.
How do i achieve this?
Thanks!
Dimo
Telerik team
 answered on 04 Mar 2010
1 answer
241 views
I have a grid with a few columns at a set width. When the window is resized smaller the columns that don't have a column size are hidden.
Is there anyway to have them not get smaller than a certain width?
Dimo
Telerik team
 answered on 04 Mar 2010
3 answers
223 views

1) How can you validate a textbox to look exactly as they do when using the input manager? 


This doesn't give me the same look that the input manager does:
<telerik:RadTextBox ID="txt_Make" Runat="server" Skin="Windows7"  
                        Width="170px"> 
                    </telerik:RadTextBox> 
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Required!" ControlToValidate="txt_Make" Display="Dynamic" SetFocusOnError="True"></asp:RequiredFieldValidator> 

I want them to look exactly like the inputmanager:
<telerik:RadInputManager ID="AppInputManager" runat="server" Skin="Windows7"> 
                  <telerik:TextBoxSetting ErrorMessage="Required!"> 
                      <TargetControls> 
                          <telerik:TargetInput ControlID="txt_FirstName" /> 
                          <telerik:TargetInput ControlID="txt_LastName" /> 
                          <telerik:TargetInput ControlID="txt_Address" /> 
                          <telerik:TargetInput ControlID="txt_City" /> 
                      </TargetControls> 
                    <Validation IsRequired="True" ValidationGroup="Application"></Validation> 
                  </telerik:TextBoxSetting> 
</telerik:RadInputManager> 




The input manager displays the icon and the message in red INSIDE the control, the validator does not.

I cant use an input manager for some of the fields because they are only required based on user input.  I tried adding an entire new input manager for these fields, but then they always try to get validated - even when hidden.  And I don't want to do a postback - I don't think I can enable and disable the input managers client-side.


Dimo
Telerik team
 answered on 04 Mar 2010
2 answers
485 views

Hi There,
I have seen this topic come up before but without an answer so I thought I'd define the problem as simply  as possible.

I have a LINQ command creating a query:

var gridData =     from au in dc.aspnet_Users 
                            join aur in dc.aspnet_UsersInRoles  
                            on au.UserId equals aur.UserId 
                            join ar in dc.aspnet_Roles  
                            on aur.RoleId equals ar.RoleId 
                            join am in dc.aspnet_Memberships  
                            on au.UserId equals am.UserId 
                   select new 
                   { 
                            au.UserName, 
                            ar.RoleName, 
                            am.Email, 
                            am.IsApproved, 
                            am.IsLockedOut 
                   }; 
 


THE IMPORTANT POINT IS THAT THIS USES MORE THAN 1 TABLE.


Note: This is accessing the Roles and Users tables in the standard MS Login scenario.


Then I have a simple RadGrid:

<telerik:RadGrid ID="rgUsers" runat="server" AllowAutomaticDeletes="True" 
        AllowAutomaticUpdates="True" AutoGenerateDeleteColumn="True" 
        AutoGenerateEditColumn="True" GridLines="None"> 
 
    <MasterTableView EditMode="InPlace"> 
       <RowIndicatorColumn> 
             <HeaderStyle Width="20px"></HeaderStyle> 
       </RowIndicatorColumn> 
       <ExpandCollapseColumn> 
             <HeaderStyle Width="20px"></HeaderStyle> 
       </ExpandCollapseColumn> 
    </MasterTableView> 
 
</telerik:RadGrid> 


Finally I bind the data to the grid in Page_Load

rgUsers.AutoGenerateColumns = true; 
rgUsers.DataSource = gridData.ToList(); 
rgUsers.DataBind(); 
 

 

This will display the data from the 4 tables correctly. 

However, when Edit is pressed on the Grid the fields are not editable.


I have tried the following:

1) 1) I can use a LinqDataSource that allows Edit/Update BUT only if there is only 1 table in the LINQ query.

2)  2) I can use a ObjectDataSource onto a dataset but once again this only works if the the dataset adaptor is accessing a single table.


I have looked at the variouse suggested demos and example code but they have all ignored the multiple table/Join problem:

http://www.telerik.com/community/code-library/aspnet-ajax/grid/automatic-operations-with-linqdatasource.aspx

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/threelevel/defaultcs.aspx

http://www.telerik.com/community/code-library/aspnet-ajax/grid/automatic-operations-with-linqdatasource.aspx

 

I am not wedded to LINQ.  I am quite happy to adapt in order to get a RadGrid that can support Update and Edit to multiple tables.


What should I do to achieve a grid that displays records composed from multiple tables with Update and Edit available?

Thanks for any help

Richard

Richard Byrne
Top achievements
Rank 1
 answered on 04 Mar 2010
2 answers
161 views
In my grid, there are two different columns for edit and delete a record.
And I am opening a popup while editing or inserting a new record.
Now, I need to display the edit and delete buttons at the top like the "Add new" button.

I came across this sample, http://demos.telerik.com/aspnet-ajax/toolbar/examples/applicationscenarios/gridcommanditem/defaultcs.aspx, in which, radtoolbar has been used. But here it is not clear how can I open a popup on edit.
Right now i have one image button and on _ItemDataBound, adding an "onclick" attribute to open popup.
I need to get DataKeyNames for selected row while opening popup.

Is there any direct way to open popup, by, edit button on top ?
Marcus
Top achievements
Rank 1
 answered on 04 Mar 2010
16 answers
413 views
I've searched all over for the solution to my problem but haven't been able to find it so I figure I must be overlooking something really simple ;-)

I've got a simple page containing one LinkButton and a RadToolTipManager (used instead of RadToolTip because in the real app there's multiple tooltips loaded on demand). The LinkButton triggers the ToolTip.

The tooltip contains a simple usercontrol, containing only one button. So far so good, tooltip opens just fine.

There is a client-script inside the usercontrol (OnClientClick for Button-control). The problem is that a javascript-error appears instead of the desired client-side behavior:

'ClientClick' is undefined.

ClientClick is defined in the user control, not in the parent page. How can I use client-scripting in usercontrols inside tooltip-templates?

Could you please point me in the right direction?

Kind regards, Martine.

ASPX:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<%@ Register Src="WebUserControl.ascx" TagName="WebUserControl" TagPrefix="uc1" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml">  
<head runat="server">  
    <title>Untitled Page</title> 
</head> 
<body> 
    <form id="form1" runat="server">  
        <telerik:RadScriptManager ID="ScriptManager1" runat="server" EnableTheming="True">  
        </telerik:RadScriptManager> 
        <br /> 
        <div> 
            <asp:LinkButton ID="LinkButton1" runat="server">Show ToolTip</asp:LinkButton><br /> 
            <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server" ManualClose="True" 
                Modal="True" OnAjaxUpdate="RadToolTipManager1_AjaxUpdate">  
                <TargetControls> 
                    <telerik:ToolTipTargetControl IsClientID="False" TargetControlID="LinkButton1" Value="" /> 
                </TargetControls> 
            </telerik:RadToolTipManager> 
            &nbsp;</div> 
    </form> 
</body> 
</html> 
 

.cs:

using System;  
using System.Data;  
using System.Configuration;  
using System.Web;  
using System.Web.Security;  
using System.Web.UI;  
using System.Web.UI.WebControls;  
using System.Web.UI.WebControls.WebParts;  
using System.Web.UI.HtmlControls;  
 
public partial class _Default : System.Web.UI.Page   
{  
    protected void Page_Load(object sender, EventArgs e)  
    {  
 
    }  
    protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)  
    {  
        WebUserControl UC = (WebUserControl)Page.LoadControl("WebUserControl.ascx");  
        e.UpdatePanel.ContentTemplateContainer.Controls.Add(UC);  
    }  
} 

ASCX:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %> 
<%@ Register Assembly="Telerik.Web.UI, Version=2008.2.826.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<asp:Button ID="Button1" runat="server" OnClientClick="ClientClick" Text="Button in UserControl" /> 
<script language="javascript" type="text/javascript">  
    function ClientClick(sender, args)   
    {  
        Alert('Clicked!');  
    }  
</script> 
 
 
Svetlina Anati
Telerik team
 answered on 04 Mar 2010
3 answers
275 views
Hello all,
I have a general question about button style navigation in RadRotator. 
I've implemented paging in my solution and my default setting is to display 10 items per page. Whether it is in horizontal or vertical display mode, once I get to item 10 (index of 9) and click 'Next/Forward', the RadRotator will move back to it Item 1 (index of 0)  - It is after all a rotator/carousel!
Is there any way to achieve (either in the RadControl properties or Code-behind) it such that once you get to the last item you can't move back to Item 1 as it were. Either being able to detect you are on the last item and disable the 'Next/Forward' button (would be ideal) or at least not do any action if the button is clicked.
Look forward to any responses/suggestions.
Regards,
Praveen.
Fiko
Telerik team
 answered on 04 Mar 2010
1 answer
105 views
When I create a tab like so:

<

 

telerik:RadTab Text="Another Tab" AccessKey="3"> </telerik:RadTab>

 

 

 

 

 



It adds a 3 (bolded and underlined) before the "Another Tab" text. What I would like to do is control the style of the "3."

I looked at the style sheets and it looks like it is adding the style inline. Is there any way to override this behavior?

I can control the style when the AccessKey is _part_ of the Text.

Thanks,
David




Yana
Telerik team
 answered on 04 Mar 2010
3 answers
126 views
I have an application that opens to a screen with a radtabstrip.  The tabstrip has 3 tabs.  The first is loaded when the page is loaded.  The second and third tabs have grids displayed in their associated pageviews.  What I would like to do is to make the grids not visible when the page loads, but have them load and display when the user clicks on the tab.  The idea is to save the resources of loading the grids until the user actually wants to see them.

I tried setting Visible = false on both grids, then I have this for my AjaxManager (I'm actually using a AjaxManagerProxy because I have a RadAjaxManager on my master page):

<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="gridCMs">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridCMs" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="gridInOpEquip">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridInOpEquip" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="tabMain">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="gridCMs" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    <telerik:AjaxUpdatedControl ControlID="gridInOpEquip" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManagerProxy> 

where tabMain is my tabstrip and gridCMs is the grid that should appear on the second tab while gridInOpEquip would show on the third tab.  Then I added this code to handle the tab_click:
Protected Sub tabMain_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles tabMain.TabClick  
        Select Case e.Tab.Value  
            Case "OpenCMs"  
                If gridCMs.Visible = False Then  
                    gridCMs.Visible = True 
                    gridCMs.DataBind()  
                End If  
            Case "InOpEquip"  
                If gridInOpEquip.Visible = False Then  
                    gridInOpEquip.Visible = True 
                    gridInOpEquip.DataBind()  
                End If  
        End Select  
    End Sub 

Yes, I did try just making it visible without the call to DataBind.  When I have this code enabled, the code executes but the tab is no longer selected, so I can't even see the selected pageview.  If I comment out this code, and change the grids from Visible=false to Visible=true, it works just fine...except that I don't have the delayed loading of the grids.

I look forward to any tips that you can provide.  Many thanks!


x
Pavlina
Telerik team
 answered on 04 Mar 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?