Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. GridViewColumn

GridViewColumn

Scheduled Pinned Locked Moved WPF
wpfcsharpwcfquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mohammed Elkholy
    wrote on last edited by
    #1

    hi evrybody i try to do task by WPF for trying the work with WPF enviroment i try to add combobox in gridview but i dont know how can i bind or fill combobox in xaml i wrote this but not enough <ListView Width="Auto" ItemsSource="{Binding}" Height="Auto" IsSynchronizedWithCurrentItem="True"> <ListView.View> <GridView> <GridViewColumn Header="Gender ID" Width="120"> <GridViewColumn.CellTemplate> <DataTemplate > <TextBox Margin="0,0,0,0" Text="{Binding Path=GenderID}" Width="100"></TextBox> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Gender Type" Width="120"> <GridViewColumn.CellTemplate> <DataTemplate> <ComboBox Name="Combo_Type" ItemsSource="{Binding Source={}" DisplayMemberPath="{Binding Path=GenderType}" Width="100"></ComboBox> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> MD_NADA

    G 1 Reply Last reply
    0
    • M Mohammed Elkholy

      hi evrybody i try to do task by WPF for trying the work with WPF enviroment i try to add combobox in gridview but i dont know how can i bind or fill combobox in xaml i wrote this but not enough <ListView Width="Auto" ItemsSource="{Binding}" Height="Auto" IsSynchronizedWithCurrentItem="True"> <ListView.View> <GridView> <GridViewColumn Header="Gender ID" Width="120"> <GridViewColumn.CellTemplate> <DataTemplate > <TextBox Margin="0,0,0,0" Text="{Binding Path=GenderID}" Width="100"></TextBox> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn Header="Gender Type" Width="120"> <GridViewColumn.CellTemplate> <DataTemplate> <ComboBox Name="Combo_Type" ItemsSource="{Binding Source={}" DisplayMemberPath="{Binding Path=GenderType}" Width="100"></ComboBox> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> MD_NADA

      G Offline
      G Offline
      Gideon Engelberth
      wrote on last edited by
      #2

      It sounds like you want to use an enum for the items source of your combobox, so this article should be a good starting point. You will probably want to bind SelectedItem="{Binding Path=GenderType}" instead of DisplayMemberPath.

      M 1 Reply Last reply
      0
      • G Gideon Engelberth

        It sounds like you want to use an enum for the items source of your combobox, so this article should be a good starting point. You will probably want to bind SelectedItem="{Binding Path=GenderType}" instead of DisplayMemberPath.

        M Offline
        M Offline
        Mohammed Elkholy
        wrote on last edited by
        #3

        thanks for reply but this not working in fact the GridView Bind to CollectionView and i want to fill the combobox in GridView by the binding to anothet table , i know how can i do this in windows forms but in WPF i see i can set binding in xaml i hope i show this point clearly

        MD_NADA

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups