Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
155 views
I have a hierarchical grid where the parent and the children all use the same column headers such as follows.  Everything looks fine when I show the Action column.  When I hide the Action column, however, the column's contents remain in the child rows (e.g., where the Type is Child in the example below) and the formatting is messed up (see below).

ActionColumn.Visible = true;
 
ID  Parent  Name    Type     Action
1   -       Note    Parent   O:E:D
2   1       Reply   Child    O:E
3   2       Reply   Child    O:E
4   -       Note    Parent   O:E:D
 
ActionColumn.Visible = false;
 
ID  Parent     Name       Type    
1   -          Note       Parent  
2   1       Reply      Child    O:E
3   2       Reply      Child    O:E
4   -          Note       Parent  

I'm setting the  grdNotes.Columns.FindByUniqueName("Actions").Visible = ShowActionColumn (where ShowActionColumn is a bool property set by the user preferences) in the Page_Load event. 

What else needs to be done to hide the contents of the child row's column contents?  (I've already tried setting toolbar.visible=false, but to no avail.)

FWIW, here's the definition of the grid:

<telerik:RadGrid ID="grdNotes" runat="server" OnColumnCreated="grdNotes_ColumnCreated"
    OnItemCreated="grdNotes_ItemCreated" OnItemDataBound="grdNotes_ItemDataBound"
    OnNeedDataSource="grdNotes_NeedDataSource" OnPreRender="grdNotes_PreRender" AutoGenerateColumns="false"
    SkinID="HierarchicalGrid" GridLines="None" AllowPaging="false" AllowCustomPaging="True"
    ShowStatusBar="True" EnableLinqExpressions="True" PageSize="20" Width="100%">
    <HeaderContextMenu EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </HeaderContextMenu>
    <ClientSettings Selecting-AllowRowSelect="true" Resizing-AllowColumnResize="true">
        <ClientEvents OnRowSelected="RowSelected" OnRowContextMenu="NoteContextMenu" OnRowCreated="RowCreated"
            OnRowDblClick="grdNotes_OnRowDblClick" OnColumnResized="ResizeAllColumns" OnGridCreated="PageLoad" />
    </ClientSettings>
    <PagerStyle Position="Bottom" AlwaysVisible="True" Mode="NextPrevAndNumeric" Wrap="False"
        BackColor="White" Font-Size="Large" />
    <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" AllowSorting="true"
        DataKeyNames="Id,ParentId,Token,IsRoot,Replies,NoteCreator" ClientDataKeyNames="Id,ParentId,Token,IsRoot,Replies,NoteCreator"
        NoDetailRecordsText="" EnableNoRecordsTemplate="False" Width="100%">
        <SelfHierarchySettings ParentKeyName="ParentId" KeyName="Id" MaximumDepth="20" />
        <Columns>
            <telerik:GridBoundColumn DataField="Id" HeaderText="Id" SortExpression="Id" UniqueName="Id"
                ReadOnly="True" HeaderStyle-Width="10%">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title"
                UniqueName="Title" HeaderStyle-Width="20%" />
            <telerik:GridBoundColumn DataField="Body" HeaderText="Body" SortExpression="Body"
                UniqueName="Body" HeaderStyle-Width="40%" />
            <telerik:GridBoundColumn DataField="CreatedBy" HeaderText="Created By" SortExpression="CreatedBy"
                UniqueName="CreatedBy" HeaderStyle-Width="15%" />
            <telerik:GridBoundColumn DataField="CreatedDate" HeaderText="Created On" SortExpression="CreatedDate"
                UniqueName="CreatedOn" HeaderStyle-Width="15%" />
            <telerik:GridBoundColumn DataField="ParentId" HeaderText="Parent Id" SortExpression="ParentId"
                UniqueName="ParentId" Visible="false" />
            <telerik:GridBoundColumn DataField="Token" HeaderText="Token" SortExpression="Token"
                UniqueName="Token" Visible="true" />
            <telerik:GridBoundColumn DataField="IsRoot" HeaderText="IsRoot" SortExpression="IsRoot"
                UniqueName="IsRoot" Visible="false" />
            <telerik:GridBoundColumn DataField="Replies" HeaderText="Replies" SortExpression="Replies"
                UniqueName="Replies" Visible="false" />
            <telerik:GridBoundColumn DataField="NoteCreator" HeaderText="NoteCreator" SortExpression="NoteCreator"
                UniqueName="NoteCreator" Visible="false" />
            <telerik:GridTemplateColumn UniqueName="Actions" HeaderStyle-Width="150" HeaderText="Actions">
                <ItemTemplate>
                    <telerik:RadToolBar ID="rtbNoteActions" runat="server" SkinID="ActionToolbar" OnButtonClick="NotesGridToolbarButtonClicked"
                        OnClientButtonClicking="NoteActionToolbarClicking">
                        <Items>
                            <telerik:RadToolBarButton Text="Properties" CommandName="Properties" ImageUrl="~/Images/page_view.gif" />
                            <telerik:RadToolBarButton Text="Reply" CommandName="Reply" ImageUrl="~/Images/page_edit.gif" />
                            <telerik:RadToolBarButton Text="Security" CommandName="Security" ImageUrl="~/Images/shield16.gif" />
                            <telerik:RadToolBarButton Text="Delete" CommandName="Delete" ImageUrl="~/Images/delete16.gif" />
                        </Items>
                    </telerik:RadToolBar>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
    <FilterMenu EnableTheming="True">
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
    </FilterMenu>
</telerik:RadGrid>
Daniel
Telerik team
 answered on 19 Jul 2010
3 answers
130 views
Hi Guys,

I am using Telerik RAD Grid Control. I am populating the Grid with ObjectDataSource, means I am filling that through coding and its working fine. Now I want to implement the custom paging for that. I gone through so many links and demos but all those are with ObjectDataSource, but I want to do without it. Can anybody help me on this issue? Pls provide provide the answer as soon as you can.

Thanks in Advance,
Bikramjit
Rosen
Telerik team
 answered on 19 Jul 2010
3 answers
117 views
Hello!

I have 2 problems with displaying RadGrid.

I have attached a picture displaying it.

First problem (RED square): Every time there is a vertical scroll displayed we get this strange white space. Any idea how to fix this?

Second problem (BLUE square) apears when client side colum resizing is possible. We think that the last column should always be connected with the right side of the grid just like the fist one is connected with the left side.

Thanks for your help!

Ales
Dimo
Telerik team
 answered on 19 Jul 2010
1 answer
36 views
Hi,

I use the editor for subcontent on pages, and therefor the AbolutePosition is no go.

Then the content is shown relative to the top left corner of the browser, and not the DIV where I place the content from the Editor.

So please add RelativePosition as well :-)

Best regards,
Christian
Dobromir
Telerik team
 answered on 19 Jul 2010
8 answers
438 views
I have a Grid setup with a self hierarchy with additional detail tables.  When I expand a top level entry, I correctly see the children (both the linked detailtables and also the self hierarchy entries).  But when I expand the next level of a entry from the self hierarchy, the linked detailtables are not displayed.

I am using the NeedDataSource method on the Grid, which checks if the event is from the detail table or not.
And also using the DetailTableDataBind as described at http://demos.telerik.com/aspnet-ajax/grid/examples/programming/detailtabledatabind/defaultcs.aspx, and when I step through the code in the debugger, the DetailTableDataBind never gets called for the detail tables when I expand below the first level.

An example of what I am trying to do is a Folder table and a File table.  You can have Folders within Folders, and Files in Folders.  If I expand the top level Folder, I can correctly see the child folders and files, but when I expand one of the child folders, it only shows folders.  It seems to skip over the detailtables.

Is this a bug, or might I be overlooking something?

Thanks,
Eric
Veli
Telerik team
 answered on 19 Jul 2010
5 answers
191 views
I am looking to change the web service method via a client side, and was wondering if there is a way to do it. I could not find one myself.

The context I am using it in is alongside a dropdownlist. The combobox searches for records based on the type selected in the dropdownlist. I change the method for when the list changes. I am trying to reduce my server side calls, and would love to be able to handle all this clientside.


Simon
Telerik team
 answered on 19 Jul 2010
1 answer
253 views
I have a very, very basic grid with a nestedviewtemplate and would like for it to be defaulted to be expanded.  I thought that was the default already but it isn't.  What am I doing wrong?

<MasterTableView AutoGenerateColumns="False" DataKeyNames="Main_Category_ID" 
            DataSourceID="sqlCatagoriesMain">
    <NestedViewTemplate>
        <asp:Label ID="lblMainID" runat="server" Text='<%# Eval("Main_Category_ID") %>' 
            Visible="False"></asp:Label>
        <asp:SqlDataSource ID="sqlCategoriesSub" runat="server" 
            ConnectionString="<%$ ConnectionStrings:BiddsConnectionString %>" 
            SelectCommand="SELECT * FROM [Categories_Sub] WHERE ([Main_Category_Link] = @Main_Category_Link) ORDER BY [Sub_Category]">
            <SelectParameters>
                <asp:ControlParameter ControlID="lblMainID" Name="Main_Category_Link" 
                    PropertyName="Text" Type="Int32" />
            </SelectParameters>
        </asp:SqlDataSource>
        <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" 
            DataSourceID="sqlCategoriesSub" GridLines="None">
            <MasterTableView DataSourceID="sqlCategoriesSub">
                <RowIndicatorColumn>
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn>
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Sub_Category_ID" UniqueName="column1" 
                        Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Sub_Category" HeaderText="Category" 
                        UniqueName="column2">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Sub_Category_Desc" HeaderText="Description" 
                        UniqueName="column">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </NestedViewTemplate>
    <ExpandCollapseColumn  Visible="True">
    </ExpandCollapseColumn>
    <Columns>
        <telerik:GridBoundColumn DataField="Main_Category_ID" DataType="System.Int32" 
            ReadOnly="True" SortExpression="Main_Category_ID" UniqueName="Main_Category_ID" 
            Visible="False">
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn DataField="Main_Category" 
            HeaderText="Main_Category" SortExpression="Main_Category" 
            UniqueName="Main_Category">
            <EditItemTemplate>
                <asp:TextBox ID="Main_CategoryTextBox" runat="server" 
                    Text='<%# Bind("Main_Category") %>'></asp:TextBox>
            </EditItemTemplate>
            <ItemTemplate>
                <asp:Label ID="Main_CategoryLabel" runat="server" Font-Bold="True" 
                    Text='<%# Eval("Main_Category") %>'></asp:Label>
                   
                <asp:LinkButton ID="lbAddNew" runat="server" CssClass="toollink">Add New Category</asp:LinkButton>
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="Main_Category_Desc" 
            HeaderText="Main_Category_Desc" SortExpression="Main_Category_Desc" 
            UniqueName="Main_Category_Desc" Visible="False">
        </telerik:GridBoundColumn>
    </Columns>
</MasterTableView>
</telerik:RadGrid>
Princy
Top achievements
Rank 2
 answered on 19 Jul 2010
1 answer
705 views
Hi there,

I would like to store and restore column widths of a RadGrid from Javascript but unfortunately I can't find a method to set the width of a column. Is there such a function in the client-side API?

Best regards,
V.
Princy
Top achievements
Rank 2
 answered on 19 Jul 2010
1 answer
113 views
Hi,
I have a radtree menu in panel bar that loads dynamically.It located on master page.
When I open a radwindow from content page , immediately the radtree vanishes and dont come back.
Please help I tried lots of things but have no solution.
Georgi Tunev
Telerik team
 answered on 19 Jul 2010
6 answers
102 views

Hi,
 I've been customising the toolbars and going through the instructions quite heavily the last couple of days. I've noticed a few quirks that I'll probably ask a few questions about later, but this one bugs me:

 When changing the following property to 'Default', one of the menu bars is chopped off and the toolbar icon that is supposed to be on the same line is now on the line below.

<property name="ToolbarMode">ShowOnFocus</property> 

 How can I prevent this from happening? The toolbar above and below this are working fine. Changing it back to 'ShowOnFocus' it works normally again.

Thanks,
Jason.
Jason Brownhill
Top achievements
Rank 1
 answered on 19 Jul 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?