StackPanel in web UI

4 posts, 0 answers
  1. Hai
    Hai avatar
    2 posts
    Member since:
    Mar 2016

    Posted 19 May Link to this post

    I would like to use StackPanel inside Grid for Web UI. But I can't find any docs or demo. How can I use StackPanel in web?
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 20 May Link to this post

    Hi Luc,

    Note that the StackPanel is control designed for WPF applications. It is not available for WebForms. However, there are various controls that you can use instead.

    Would you elaborate on what is the behavior that you would like to implement? What are your requirements and what should be the expected result?


    Regards,
    Viktor Tachev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Hai
    Hai avatar
    2 posts
    Member since:
    Mar 2016

    Posted 22 May Link to this post

    Hi Viktor,

    Thank for your response. I would like to port my code to WebForm, please see bellow:

    <telerik:RadGridView x:Name="grdFloor"
    AutoGenerateColumns="False"
    Grid.Row="1"
    IsFilteringAllowed="False"
    RowIndicatorVisibility="Collapsed"
    IsReadOnly="True"
    GridLinesVisibility="None"
    ShowColumnHeaders="False"
    CanUserFreezeColumns="False"
    CanUserResizeColumns="False"
    CanUserSelect="False"
    ShowGroupPanel="False"
    BorderThickness="0"
    BorderBrush="{x:Null}"
    RowDetailsVisibilityMode="VisibleWhenSelected"
    RowDetailsTemplate="{StaticResource MainContentFloorDetails}"
    RowDetailsStyle="{StaticResource DetailsPresenterNoBorderStyle}"
    RowStyle="{StaticResource GridViewRowStyleEmpty}"
    RowHeight="40"
    Margin="10 0 0 0"
    ScrollViewer.HorizontalScrollBarVisibility="Disabled">
     
    <telerik:GridViewDataControl.Columns>
    <telerik:GridViewToggleRowDetailsColumn CellStyle="{StaticResource GridViewCellStyleToggle}" />
    <telerik:GridViewDataColumn CellStyle="{StaticResource GridViewCellStyleEmpty}">
    <telerik:GridViewColumn.CellTemplate>
    <DataTemplate>
    <Grid x:Name="gridMain" VerticalAlignment="Center" HorizontalAlignment="Left">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
    <RowDefinition Height="32" />
    <RowDefinition Height="Auto" />
    <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <!-- Stacking bar diagram -->
    <Border x:Name="bdStackingBar"
    Style="{StaticResource StackBarItemStyle}"
    Grid.Column="0"
    Grid.Row="0"
    Margin="5 1 1 1"
    MouseLeftButtonUp="bdStackingBar_MouseLeftButtonUp">
    <StackPanel x:Name="stpnlStackingBar"
    Orientation="Horizontal"
    Background="Transparent">
    </StackPanel>
    </Border>

    <!-- Link action areas for placed -->
    <Grid x:Name="gridPlacedActionLink"
     Grid.Row="1"
     Grid.Column="0"
     Margin="5 0 0 0"
     Visibility="Collapsed" HorizontalAlignment="Left">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <StackPanel Orientation="Horizontal" 
    HorizontalAlignment="Left">
    <HyperlinkButton x:Name="hbnClear"
    Content="{Binding linkClear, Source={StaticResource MyRS}}"
    Click="hbnClear_Click"
    Style="{StaticResource ActionLinkInPanel}"/>
    <HyperlinkButton x:Name="hbnClearPartial"
    Content="{Binding linkClearPartial, Source={StaticResource MyRS}}"
    Click="hbnClearPartial_Click"
    Style="{StaticResource ActionLinkInPanel}" />
    <HyperlinkButton x:Name="hbnShowDetails"
    Content="{Binding linkShowDetails, Source={StaticResource MyRS}}"
    Click="hbnShowDetails_Click"
    Style="{StaticResource ActionLinkInPanel}" />
    </StackPanel>
    </Grid>

    <!-- Link action areas for unplaced -->
    <Grid x:Name="gridUnPlacedActionLink"
     Grid.Row="2"
     Grid.Column="0"
     Margin="5 0 0 0"
     Visibility="Collapsed" HorizontalAlignment="Left">
    <Grid.ColumnDefinitions>
    <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <StackPanel Orientation="Horizontal" 
    HorizontalAlignment="Left">
    <HyperlinkButton x:Name="hbnPlace"
    Content="{Binding linkPlace, Source={StaticResource MyRS}}"
    Grid.Column="0"
    Grid.Row="0"
    Click="hbnPlace_Click"
    Style="{StaticResource ActionLinkInPanel}" />
    <HyperlinkButton x:Name="hbnPlacePartial"
    Content="{Binding linkPlacePartial, Source={StaticResource MyRS}}"
    Grid.Column="1"
    Grid.Row="0"
    Click="hbnPlacePartial_Click"
    Style="{StaticResource ActionLinkInPanel}" />
    <HyperlinkButton x:Name="hbnShowSuitability"
    Content="{Binding linkShowSuitability, Source={StaticResource MyRS}}"
    Grid.Column="2"
    Grid.Row="0"
    Click="hbnShowSuitability_Click"
    Style="{StaticResource ActionLinkInPanel}" />
    </StackPanel>
    </Grid>
    </Grid>
    </DataTemplate>
    </telerik:GridViewColumn.CellTemplate>
    </telerik:GridViewDataColumn>
    </telerik:GridViewDataControl.Columns>
    </telerik:RadGridView>

  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 25 May Link to this post

    Hi Hai,

    Please examine the section in our documentation that describes how the RadGrid control works and how you can provide data for it. Also, check out the online examples that shows various scenarios that you can implement with RadGrid.


    The resources should get you started on using RadGrid. If you have additional queries regarding our controls do not hesitate to contact us. You can submit a support ticket or post in the forums.

    Regards,
    Viktor Tachev
    Telerik
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top