Home Forums WPF controls Xceed DataGrid for WPF Problem with grid cells

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26299 |

    I have one problem with Xceed grid, if it possible, can you help me?

    I start use a grid and I need to do:

    grid with 4 columns:
    1. checkbox
    2. image
    3. text
    4. button

    it’s ok, no problem

    but , after binding data to grid, I have a problem
    1. checkbox and button not visible
    2. after use scrollbar down and then up, image disappear and I can see checkbox and button
    3. I make checkbox unchecked in some rows, then again use scrollbar down and then up, and checkbox checked…

    what is the problem? what I need to do?
    Thanks

    P.S.
    xaml code:

    <xcdg:CellEditor x:Key=”ClipImage”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <Image HorizontalAlignment=”Left” Margin=”0,0,0,5″ Stretch=”Fill” Width=”45″ Height=”45″ VerticalAlignment=”Bottom” />
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    </xcdg:CellEditor>

    <xcdg:CellEditor x:Key=”ClipCheck”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <CheckBox IsChecked=”True” Margin=”0,0,0,0″ VerticalAlignment=”Center” HorizontalAlignment=”Center” Width=”20″></CheckBox>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    </xcdg:CellEditor>

    <xcdg:CellEditor x:Key=”ClipPreview”>
    <xcdg:CellEditor.EditTemplate>
    <DataTemplate>
    <Button HorizontalAlignment=”Center” Margin=”0,0,0,5″ Width=”50″ Height=”20″ VerticalAlignment=”Center”>Preview</Button>
    </DataTemplate>
    </xcdg:CellEditor.EditTemplate>
    </xcdg:CellEditor>

    ……

    <xcdg:DataGridControl x:Name=”FilmList”
    Margin=”3,3.5,-39,0″
    AutoCreateColumns=”False” NavigationBehavior=”RowOnly”
    CellEditorDisplayConditions=”Always” Grid.ColumnSpan=”2″>

    <xcdg:DataGridControl.View>
    <xcdg:TableView ShowRowSelectorPane=”False” Theme=”Aero.NormalColor”>
    <xcdg:TableView.FixedHeaders>
    <xcdg:ClearHeadersFooters/>
    </xcdg:TableView.FixedHeaders>
    </xcdg:TableView>
    </xcdg:DataGridControl.View>

    <xcdg:DataGridControl.Columns>
    <xcdg:Column FieldName=”ClipCheck” Title=”CheckBox” Width=”30″ CellEditor=”{StaticResource ClipCheck}”/>
    <xcdg:Column FieldName=”ImageSourceUrl” Title=”Image” Width=”50″ CellEditor=”{StaticResource ClipImage}”/>
    <xcdg:Column FieldName=”ClipTitle” Title=”Title” Width=”100″/>
    <xcdg:Column FieldName=”ClipPreview” Title=”Image” Width=”55″ CellEditor=”{StaticResource ClipPreview}”/>
    </xcdg:DataGridControl.Columns>

    </xcdg:DataGridControl>

    C# code:

    FilmList.ItemsSource = main.clips;

    Imported from legacy forums. Posted by Yury (had 2885 views)

    Xceed Support
    Member
    Post count: 5658

    In the code you provided, you are only changing the CellEditor, which is used when a cell is in edit mode. If you want the cell to be displayed using the button or checkbox, you will need to change their appropriate CellContentTemplate.

    Another issue is that you are always displaying the cell editors. This is not recommended pratice as it causes a major hit on performance. I suggest you change it to MouseOverCell and/or MouseOverRow instead.

    Imported from legacy forums. Posted by Jenny [Xceed] (had 189 views)

    User (Old forums)
    Member
    Post count: 23064

    Yes, I understand it.
    If it possible, can you show an example how to change CellContentTemplate.
    may be you have any examples, and post them here?

    Best regards, Yurijs

    Imported from legacy forums. Posted by Yury (had 319 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks a lot, I use CellContentTemplate, and everything work in need way )

    Imported from legacy forums. Posted by Yury (had 3853 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.