This is a migrated thread and some comments may be shown as answers.

StackPanel in web UI

3 Answers 199 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Luc
Top achievements
Rank 1
Luc asked on 20 May 2016, 03:41 AM
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?

3 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 20 May 2016, 11:28 AM
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.
0
Luc
Top achievements
Rank 1
answered on 23 May 2016, 02:26 AM

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>

0
Viktor Tachev
Telerik team
answered on 25 May 2016, 12:00 PM
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.
Tags
Grid
Asked by
Luc
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Luc
Top achievements
Rank 1
Share this question
or