3 Answers, 1 is accepted
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
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>
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.
- http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/getting-started/getting-started-with-radgrid-for-asp.net-ajax
- http://demos.telerik.com/aspnet-ajax/grid/examples/overview/defaultcs.aspx
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