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.
Unfortunately, activation email could not send to your email. Please try again.

GridDataControl and ItemContainerStyle

Thread ID:

Created:

Updated:

Platform:

Replies:

107805 Mar 18,2013 01:02 PM May 7,2013 11:39 PM WPF 4
loading
Tags: GridControl
Charalampos Kouris
Asked On March 18, 2013 01:02 PM

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


Charalampos Kouris
Replied On March 18, 2013 06:14 PM

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



Rajasekar G [Syncfusion]
Replied On April 2, 2013 12:38 AM

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


Charalampos Kouris
Replied On April 18, 2013 03:41 AM

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


Rajasekar G [Syncfusion]
Replied On May 7, 2013 11:39 PM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;