none
datatrigger question

    Question

  •  
    Hei, I want to know if it's possible to: 
    1)create a green border when in a datagrid I Insert a new row 
    2)have an ico image in datagridrowheader(like execel) 
    that indicates that row is changed 
    3)it's possible to sort the datagrid row in manner to have new line at first row?? 
    thanks The first question i resolve but don't the second the first i solve so 
    
    

     

    <DataTrigger Binding="{Binding Path=IsNew}" Value="True"> 
     <DataTrigger.Setters> 
       <Setter Property="BorderBrush" Value="Green"/> 
        <Setter Property="BorderThickness" Value="2.0"/> 
        <Setter Property="VerticalContentAlignment" Value="Center"/> 
    </DataTrigger.Setters> </DataTrigger>

     

     misfortunately i don't find the same property for the update row i have tryed with IsModified, Item.Update or others but nothing to do. do someone of you Know how to resolve?? I have tryed aso with datatemplate

     

     

    <DataTemplate x:Key="rowHeaderTemplate"> 
    <StackPanel Orientation="Horizontal"> 
    <Image x:Name="editImage" Source="../images/signature-icon.png" Width="20" Height="20" Margin="1,0" Visibility="Hidden"/> 
    </StackPanel> 
    <DataTemplate.Triggers> 
    <DataTrigger Binding="{Binding RelativeSource
    ={RelativeSource FindAncestor, AncestorType={x:Type DataGridRow}
    ,AncestorLevel=1},Path=IsChanged, Mode=TwoWay}" Value="True">
     <Setter TargetName="editImage" Property="Visibility" Value="Visible"/> 
    </DataTrigger>
     </DataTemplate.Triggers>
     </DataTemplate> 

     

     

    also with Path=Item.IsEditing, Mode=TwoWay but nothing to do also with datatemplate. If I have an error i have just built an X ico imago that appears on datagridrow but when i built a datatemplate It disapperas it seems that the update image file that i don'ts ee replace the error image....thanks alot for the answers best regards Fontanel p.s. there is a link that is in c# but i work in vb.net that doesn't work

    http://blog.spencen.com/2009/04/26/editing-indicator-in-datagrid-row-header.aspx


    Thursday, March 24, 2011 12:09 PM

All replies

  • It will be great if you can repost with good formating. 
    Ajosh Jose
    Thursday, March 24, 2011 3:59 PM
  • scuse me the html page doesn't see yestrday a toolbar to insert the code today yes ...now try tosee it would be ok best regards Fontanel
    Friday, March 25, 2011 8:33 AM
  • Hi squeezed6902,

    #3 it's possible to sort the datagrid row in manner to have new line at first row??

    Sorry I don't quite understand you at this requirement. Could you kindly elaborate it?

    And for requirement #2, as you have referred in your post, the IsEditingRowItem property on the DataGrid is internal. So you must implement your own IsEditing Property.

    Best regards


    Yves Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 29, 2011 3:15 PM
  • hi the second i'm new of this environment and my goal is , like excel, if an user go in in a cell to show in a datagridrowheader an image... i don't understand ...internal...there is some example about i built internal built-in?? i understand that i must replace default method with a new... the third is perhaps simple...iwould like that an user doesn't scroll at end of datagrid to insert a new row but at first row of datagrid... i hope that a day there is a possibility to insert an image in manner to see my solution better in this forum... best regards Fontanel
    Wednesday, March 30, 2011 7:33 AM
  • Hi squeezed6902,

    I'm not quite following you. Are you searching for a ready-made feature?

    If that is the case unfortunately to the best of my knowledge there is not such a built-in behavior in WPF.

    Otherwise could you be more clear about what you're asking? Thanks!


    Yves Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 31, 2011 2:13 PM
  • thanks if there is is better i autoresolve the second

    i set

     

     

    <EventSetter Event="PreviewMouseLeftButtonDown" Handler="DataGridCell_PreviewMouseLeftButtonDown"></EventSetter

    >

    and in that handle i recall my image....

    now i'm trying to insert in xaml in the trigger isNew an image but how can i do??

    i want to write this....

    <DataTrigger Binding="{Binding Path=IsNew}" Value="True"> 
     <DataTrigger.Setters> 
      <Setter Property="BorderBrush" Value="Green"/> 
      <Setter Property="BorderThickness" Value="2.0"/> 
      <Setter Property="VerticalContentAlignment" Value="Center"/> 
    <setter Property="Image" path="new.ico"/>
    </DataTrigger.Setters> </DataTrigger>
     

    but i'm trying in variuos manner but i don't succeed in....

    if you don't undertstand can i upload an image of my form???

    perhaps seeing it you undertsand my scope...

     

    best regards

    Fontanel

    Wednesday, April 06, 2011 7:57 AM
  • Fontanel, first

    <setter Property="Image" path="new.ico"/>


    what element this setter is applied on? I wonder the property Image if your custom property. Please kindly fill me in on.

    The way for posting an image:

    You can upload the image into your windows live space, then open this image in your space, select this image and copy it into the reply textbox, and then you can submit an image on your post.


    Yves Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 07, 2011 8:27 AM
  • Hi the element is

     

     

    <Style x:Key="DataGridRowHeaderBackgroundStyle" TargetType="{x:Type DataGridRowHeader

    }">

     

     

     

    for the rest i don't succeed to understand .."You can upload the image into your windows live space" live space is HTML or   button??? however perhaps for my network problem i don't succeed in seeing them i see only a blank page

    http://i3.social.microsoft.com/Forums/resources/tiny_mce/plugins/codeblock/dialog.htm?cver=1864.525%0d%0a 

    now i'm crazying to try to set an image on new row on a dataGrid object i try to set a template in which with geometry built in a picture.... but i would like an image instead of it.

     

     

    best regards

    Fontanel

    Wednesday, April 13, 2011 7:41 AM
  • Nope, Fontanel,  windows live space is your skydrive netdisk http://skydrive.live.com/ .


    Yves Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, April 14, 2011 7:00 AM
  • HI I CREATE A FOLDER AND I ADD A FILE WHERE I DESCRIBE MY GOALS  BUT HOW DO I SEE YOU?

    BEST REGARDS

    Thursday, April 14, 2011 2:39 PM
  • Oh, just copy the file link and paste it here.


    Yves Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, April 15, 2011 3:45 AM