We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataControl and ItemContainerStyle

Hallo,

I have a standard WPF-DataGrid like this:

<DataGrid Name="dgEmployee" AutoGenerateColumns="True" IsReadOnly="True"     SelectionMode="Single" ItemsSource="{Binding Employee, NotifyOnSourceUpdated=True}">            <DataGrid.ItemContainerStyle>
        <Style TargetType="{x:Type DataGridRow}">
            <Setter Property="caliburn:Message.Attach"
                        Value="[Event MouseDoubleClick] = [Action OpenChild($executionContext)]"/>
        </Style>
    </DataGrid.ItemContainerStyle>          
</DataGrid>

When I double click on a row, then in my ViewModel the OpenChild(Employer emp) method is called and the row context is given as argument . These works thanks to the Caliburn Micro framework.

Now I of course would like to use the Syncfusion-GridDataControl but obviously it does not have an ItemContainer like the standard one or I can't find it. What is the equivalent part of the GridDataControl, is it possible to style it like that? I have a workaround but it's not the best solution and I still try to go via styling the "ItemContainer".

Thanks in advance
Charalampos


4 Replies

CK Charalampos Kouris March 18, 2013 10:14 PM UTC

Hallo again,

I forgot to mention that I've already made some tries for example with RowStyle:

<syncfusion:GridDataControl Name="gdcEmployee" ItemsSource="{Binding Employee}" ShowGroupDropArea="True" ShowAddNewRow="False" AllowDelete="False" AllowEdit="False"   AllowSelection="None" EnableBlendStyling="True" ActivateCurrentCellBehavior="None">
    <!--<syncfusion:GridDataControl.RowStyle>                   
        <Style TargetType="{x:Type syncfusion:GridDataRowControl}">
            <Setter Property="caliburn:Message.Attach"
                Value="[Event MouseDoubleClick] = [Action OpenChild($dataContext)]"/>                
            </Style>
    </syncfusion:GridDataControl.RowStyle>-->
</syncfusion:GridDataControl>

But unfortunally no success so far.

Cheers
Charalampos




RG Rajasekar G Syncfusion Team April 2, 2013 04:38 AM UTC

Hi Charalampos,

 

Thank you for contacting Syncfusion support.

We have analyzed your query and we have achieved your requirement by using the following code snippet. 

 

Code Snippet[C#]:

<syncfusion:GridDataControl x:Name="SyncGrid" 

                            SelectedItem="{Binding SelectedItem}"

                            syncmvvm:GridDataControlCellClickCommandWithEventArgs.Command="{Binding SelectedItemChanged}" 

                            ShowAddNewRow="False" 

                            AutoPopulateColumns="False"

                            AllowDrop="True" 

                            AllowEdit="False"

                            ItemsSource="{Binding GDCSource}" >  

 

For your reference, we have also prepared the sample based on your requirement and please find the sample in the below location,

Sample: GridDataControlSample.zip

 

Please let us know if you have any queries.

Thanks,

Rajasekar



CK Charalampos Kouris April 18, 2013 07:41 AM UTC

Hi Rajasekar,

thanks for you answer. Unfortnately this is not exact what I've asked for. Question was if the Syncfusion-GridDataControl has something like an ItemContainer and, if yes , how is it possible to style this. I already have an easy solution with binding the selected item but I wanted to try on the other way.

Anyway, thanks a lot for your answer and showing me something new.

Cheers!
Charalampos



RG Rajasekar G Syncfusion Team May 8, 2013 03:39 AM UTC

Hi Charalampos, 

Sorry for the delay.

At present there is no support for ItemContainerStyle API in GridDataControl. You have to use the Style and GridDataStyleManager in GridDataControl to apply style in the GridDataControl

Please let us know if you have any questions.

Regards,

Rajasekar


Loader.
Live Chat Icon For mobile
Up arrow icon