Click here to Skip to main content
14,456,157 members

Silverlight / WPF

 
PinnedHOW TO ANSWER A QUESTION PinPopular
Chris Maunder16-Jul-09 4:09
cofounderChris Maunder16-Jul-09 4:09 
PinnedHow to get an answer to your question PinPopular
Chris Maunder16-Jul-09 4:05
cofounderChris Maunder16-Jul-09 4:05 
QuestionTextBox DynamicResource Not Working Pin
Kevin Marois19-Feb-20 9:39
professionalKevin Marois19-Feb-20 9:39 
QuestionDock DataGrid's column to the right Pin
Mc_Topaz9-Feb-20 22:46
MemberMc_Topaz9-Feb-20 22:46 
AnswerRe: Dock DataGrid's column to the right Pin
Gerry Schmitz10-Feb-20 3:33
mveGerry Schmitz10-Feb-20 3:33 
AnswerRe: Dock DataGrid's column to the right Pin
Richard Deeming10-Feb-20 9:55
communityengineerRichard Deeming10-Feb-20 9:55 
GeneralRe: Dock DataGrid's column to the right Pin
Mc_Topaz10-Feb-20 22:24
MemberMc_Topaz10-Feb-20 22:24 
Question[WPF] Datagrid With Dynamic column Pin
mjaniaut4-Feb-20 20:57
Membermjaniaut4-Feb-20 20:57 
I want to create a datagrid with dynamic row and column.

I know how create a datagrid and bind the Itemsource.

How define the dynamic column ?

Perhaps you have a short example.

<DataGrid
                x:Name="ListViewFiles"
                MaxWidth="2560"
                MaxHeight="1600"
                AutoGenerateColumns="False"
                CanUserAddRows="False"
                CanUserSortColumns="True"
                CellStyle="{StaticResource Content_DataGrid_Centering}"
                DockPanel.Dock="Top"
                EnableColumnVirtualization="True"
                EnableRowVirtualization="True"
                ItemsSource="{Binding Path=CloudInterface.ListViewFile}"
                PreviewMouseLeftButtonDown="Drag_PreviewMouseLeftButtonDown"
                PreviewMouseMove="ListViewFiles_PreviewMouseMove"
                RowHeaderWidth="0"
                ScrollViewer.CanContentScroll="True"
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                SelectionMode="Single">
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding ConfigItem.MostRecentConfigFile.Product}">
                        <DataGridTextColumn.HeaderTemplate>
                            <DataTemplate>
                                <DockPanel>
                                    <Label Content="{Binding Lab_Product, Source={StaticResource Resources}}" />
                                </DockPanel>
                            </DataTemplate>
                        </DataGridTextColumn.HeaderTemplate>
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="5" />
                                <Setter Property="Padding" Value="5" />
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
                    <DataGridTextColumn Binding="{Binding ConfigItem.MostRecentConfigFile.ArchitectureSoftwareVersion}">
                        <DataGridTextColumn.HeaderTemplate>
                            <DataTemplate>
                                <DockPanel>
                                    <Label Content="{Binding Lab_Version, Source={StaticResource Resources}}" />
                                </DockPanel>
                            </DataTemplate>
                        </DataGridTextColumn.HeaderTemplate>
                        <DataGridTextColumn.ElementStyle>
                            <Style TargetType="{x:Type TextBlock}">
                                <Setter Property="Margin" Value="5" />
                                <Setter Property="Padding" Value="5" />
                            </Style>
                        </DataGridTextColumn.ElementStyle>
                    </DataGridTextColumn>
               </DataGrid.Columns>
            </DataGrid>

AnswerRe: [WPF] Datagrid With Dynamic column Pin
Gerry Schmitz4-Feb-20 22:21
mveGerry Schmitz4-Feb-20 22:21 
AnswerRe: [WPF] Datagrid With Dynamic column Pin
Richard Deeming5-Feb-20 1:48
communityengineerRichard Deeming5-Feb-20 1:48 
QuestionIm new bie help me fix 1 erorr on wpf, i cant do it? Pin
Member 1468037212-Jan-20 17:07
MemberMember 1468037212-Jan-20 17:07 
GeneralRe: Im new bie help me fix 1 erorr on wpf, i cant do it? Pin
Richard MacCutchan12-Jan-20 23:12
communityengineerRichard MacCutchan12-Jan-20 23:12 
AnswerRe: Im new bie help me fix 1 erorr on wpf, i cant do it? Pin
ZurdoDev13-Jan-20 2:07
mveZurdoDev13-Jan-20 2:07 
QuestionRoutedEvent Pass EventArg Pin
Kevin Marois11-Jan-20 17:42
professionalKevin Marois11-Jan-20 17:42 
AnswerRe: RoutedEvent Pass EventArg Pin
Gerry Schmitz11-Jan-20 21:24
mveGerry Schmitz11-Jan-20 21:24 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois12-Jan-20 11:05
professionalKevin Marois12-Jan-20 11:05 
GeneralRe: RoutedEvent Pass EventArg Pin
Gerry Schmitz13-Jan-20 14:23
mveGerry Schmitz13-Jan-20 14:23 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois14-Jan-20 6:18
professionalKevin Marois14-Jan-20 6:18 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois14-Jan-20 6:43
professionalKevin Marois14-Jan-20 6:43 
AnswerRe: RoutedEvent Pass EventArg Pin
Richard Deeming13-Jan-20 9:00
communityengineerRichard Deeming13-Jan-20 9:00 
GeneralRe: RoutedEvent Pass EventArg Pin
Kevin Marois14-Jan-20 10:02
professionalKevin Marois14-Jan-20 10:02 
QuestionCalculate the textbox value based on the value of combobox ? ( wpf ) Pin
Member 146803727-Jan-20 20:44
MemberMember 146803727-Jan-20 20:44 
QuestionRe: Calculate the textbox value based on the value of combobox ? ( wpf ) Pin
Richard MacCutchan7-Jan-20 22:17
communityengineerRichard MacCutchan7-Jan-20 22:17 
AnswerRe: Calculate the textbox value based on the value of combobox ? ( wpf ) Pin
Member 146803727-Jan-20 22:49
MemberMember 146803727-Jan-20 22:49 
SuggestionRe: Calculate the textbox value based on the value of combobox ? ( wpf ) Pin
Richard Deeming8-Jan-20 1:46
communityengineerRichard Deeming8-Jan-20 1:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.