Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
189 views
Is there a way to increase the height of the RadWindow header, and or possibly add custom content to it, like an image or a dropdown control? I know I can add custom buttons to the area in the top right, but what if I wanted to add a level below this...
Dobromir
Telerik team
 answered on 15 Mar 2013
32 answers
1.3K+ views

Hi

For long time I've been trying to achieve simple functionality: nest one rad grid into another, to get something similar to PanelBar. I simply want to be able to click on a row, which would then expand and show inner rad grid. This I've managed to do. However, I'm having really big problem with using this mechanism since all commands from nested grid are transferred automatically to master grid. This way I cannot select nested grid's row because each click collapses my master row.

I've tried already setting inner grid's ItemCommand event,but with no success, still incorrect (in my opinion) behavior occurs.

Below I'm posting snippet with aspx and some code to manage those grid. Could you help me resolving this issue? How can I be able to select row from nested grid? Or process any item command for nested grid?

<telerik:RadGrid ID="gridNodes" runat="server"
 AutoGenerateColumns="false"
 ShowHeader="false"
 GridLines="None">
    <ClientSettings EnablePostBackOnRowClick="true"
EnableRowHoverStyle="true" />
    <MasterTableView GroupLoadMode="Server"
 DataKeyNames="NodeId"
 AutoGenerateColumns="false"
 Name="master">
        <NestedViewTemplate>
            <asp:Panel ID="pnlStatements" runat="server">
                <telerik:RadGrid ID="gridStatements" runat="server"
 AutoGenerateColumns="false"
 ShowHeader="false">
                    <MasterTableView Name="inner">
                        <Columns>
                            <telerik:GridNumericColumn DataField="Id" Visible="false" />
                            <telerik:GridBoundColumn DataField="Value" />
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </asp:Panel>
        </NestedViewTemplate>
        <Columns>
            <telerik:GridBoundColumn UniqueName="NodeName"
 HeaderText="Node name"
 DataField="NodeName" />
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
 and code behind:

Protected Sub gridNodes_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) _
    Handles gridNodes.NeedDataSource
    Me.gridNodes.DataSource = Me.ConsumptionContextViewModel.GetNodeWithParents()
End Sub
 
Protected Sub gridNodes_DataBound(ByVal sender As Object, ByVal e As EventArgs) _
    Handles gridNodes.DataBound
    If (gridNodes.Items.Count > 0) Then
        gridNodes.Items(0).Expanded = True
    End If
End Sub
 
Protected Sub gridNode_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) _
    Handles gridNodes.ItemCreated
    If (TypeOf (e.Item) Is GridNestedViewItem) Then
        Dim typeContent = DirectCast(e.Item.FindControl("gridStatements"), RadGrid)
        AddHandler typeContent.NeedDataSource, AddressOf Me.gridStatements_NeedDataSource
        AddHandler typeContent.ItemCommand, AddressOf Me.gridStatements_ItemCommand
    End If
End Sub
 
Protected Sub gridStatements_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs)
    Dim grid = DirectCast(sender, RadGrid)
    Dim nodeId = DirectCast(grid.NamingContainer, GridNestedViewItem).ParentItem.GetDataKeyValue("NodeId")
    grid.DataSource = Me.ConsumptionContextViewModel.GetTextsForNode(CInt(nodeId))
End Sub
 
Protected Sub gridNode_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) _
    Handles gridNodes.ItemCommand
    Select Case e.CommandName
        Case RadGrid.ExpandCollapseCommandName
            If (Not TypeOf (e.Item) Is GridDataItem) Then
                Return
            End If
 
            ' close all items except current. e.Item.Expanded will be expanded after leaving ItemCommand method
            For Each item As GridItem In gridNodes.MasterTableView.Items
                If item.Expanded AndAlso item IsNot e.Item Then
                    item.Expanded = False
                End If
            Next
 
            ' select expanded row
            e.Item.FireCommandEvent(RadGrid.SelectCommandName, e)
            ' explicitly rebind inner container
            If (e.Item.Expanded = False) Then
                Dim dataItem = DirectCast(e.Item, GridDataItem)
                Dim innerContainer = DirectCast(dataItem.ChildItem.FindControl("gridStatements"), RadGrid)
                innerContainer.Rebind()
            End If
        Case "RowClick"
            ' manually fire expand event
            e.Item.FireCommandEvent(RadGrid.ExpandCollapseCommandName, New GridExpandCommandEventArgs(e.Item, sender, e))
        Case Else
            ' do nothing
    End Select
End Sub

Regards,

Pako

Vasil
Telerik team
 answered on 15 Mar 2013
13 answers
240 views
Hi,

I have 2 web applications. First one is our company project where we use Telerik's grid. I'm trying to export grid to MS Excel file by clicking grid's context menu option using the following code:

this.Grid.ExportSettings.ExportOnlyData = true;
this.Grid.ExportSettings.OpenInNewWindow = true;
this.Grid.MasterTableView.ExportToExcel();

But, Firefox's download dialog doesn't show up.

The second application is simpler test application where Telerik's grid is used as well. When I click grid's context menu option download dialog shows up.

It's obvious it's up to something in the code in first more complex application, but I can't find what for now. I'm just wondering if there's any setting I forgot to set up...

I appreciate any help.

Goran
Radoslav
Telerik team
 answered on 15 Mar 2013
8 answers
172 views
Hello,

I have some z-index related problem, my radwindow is displayed behind the youtube flash object. 

Here is my test code,

<script type="text/javascript">          
            function ShowDescriptionForm() {

                window.radopen("test.aspx", "ShowComment");
                return false;
            }
</script>


<
div align="center"
        <object style="height: 245px; width: 301px;"
            <param name="movie" value="http://www.youtube.com/v/cL9Wu2kWwSY&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1"
            </param> 
            <param name="allowFullScreen" value="true"></param> 
            <param name="allowScriptAccess" value="always"></param> 
            <embed src="http://www.youtube.com/v/cL9Wu2kWwSY&color1=0xb1b1b1&color2=0xcfcfcf&feature=player_embedded&fs=1" 
                type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" 
                width="301" height="245"></embed></object
        <br /> 
        <br /> 
        <br /> 
        <p> 
            <asp:LinkButton runat="server" ID="lbtnTest" Text="Test" OnClientClick="return ShowDescriptionForm();"></asp:LinkButton> 
        </p> 
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server" > 
            <Windows> 
                <telerik:RadWindow ID="ShowComment" runat="server" Width="600px" Style="z-index: 10000" 
                    Height="650px" Modal="true" ShowContentDuringLoad="false" VisibleStatusbar="false" /> 
            </Windows> 
        </telerik:RadWindowManager> 
    </div> 


Please help me to solve my problem.
I am using Telerik new released Q2 2009.





Thanks,
Amol Wable | amolwable.com
dhlennon
Top achievements
Rank 1
 answered on 15 Mar 2013
9 answers
250 views
Hey guys,
I am new to telerik controls and currently evaluate leveraging the radGrid with a GridAttachmentColumn. What we want to do is to write the filename of a currently uploaded file into a textfield outside of the grid into a textbox (called "latest upload"). Unfortunately I have no idea, how to attach to the Client-Side events of this column or the respective grid Event, thrown by this column type.

I read, that this column is rendered as a radUpload control when the grid is in edit mode, which is our case. This controls' documentation offers the clientFileSelected Event, that is not offered by a radGrid. In the AttachmentColumn Demo (here) there was shown a way to handle certain "GridCommands" by assigning an eventHandler to the "OnCommand" Event of the Grid and then asking for the commandName by such a function:
function gridCommand(sender, args) {
        if (args.get_commandName() == "DownloadAttachment") {
               // some logic here
        }
    }

What I wanted to do is to listen to the event, thrown by the radUpload control to retrieve the filename and then write it somewhere else, but no matter what I do in the radUpload, I am not stepping into this script, since it obviously does not throw GridCommands.
As far as I searched I could not find a way to attach to events "just inside this column". Can anyone tell me how to attach to what is presented as the "OnClientFileSelected" Event in the radUpload Control (here)?

Best regards!
Peter
Antonio Stoilkov
Telerik team
 answered on 15 Mar 2013
1 answer
89 views
Hello,

So I have a radgrid, and in this radgrid I have a "User" column, and and "Email" column.
The "Email" column is a gridbuttoncolumn.
I want to have that link button to email the selected user on that row when clicked.
Is this possible? I am a beginner, and I am working in vb.net

PLEASE HELP!
Shinu
Top achievements
Rank 2
 answered on 15 Mar 2013
1 answer
95 views
Hi,
Is it possible to display a tree view inside a raddropdown list?

Thank you,
Ben
Princy
Top achievements
Rank 2
 answered on 15 Mar 2013
1 answer
109 views
Hi, I was wondering how I could use one grid, or maybe some master/detail grid to update/insert records from four tables at once.

Here are the four tables:
Users
Roles
Permissions
Accounts

Those are all related and need to all have records for the app to work.

I was hoping that this already has been done, and that there is a nice way to achieve that.

Thank you for your help.
Shinu
Top achievements
Rank 2
 answered on 15 Mar 2013
1 answer
81 views
HI,


    i have the date format like 2/8/2013 from this i want only 8 how can i get it.
    that means i want to get particular part from the date format.




 Thanking You,
 P.Mugil
Princy
Top achievements
Rank 2
 answered on 15 Mar 2013
2 answers
197 views
Hi,

I have the need to make a combobox witth a treeview in it, and have looked at the example given in the live samples.
However the samples use a hardcoded id when referencing the combobox in the NodeClicking handler.

function nodeClicking(sender, args)
{
            var comboBox = $find('RadComboBox1');
            var node = args.get_node()
            
            comboBox.set_text(node.get_text());
            
            comboBox.hideDropDown();
}

This is not usable for a real world control as one might want multiple such controls on the same page.
So I need to be able to send the nodeClicking handler the id of the combobox, so that I can register the javascript on the page once.

Thanks in advance,
Thomas Scheelhardt
msigman
Top achievements
Rank 2
 answered on 15 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?