Studio for Silverlight

C1DataGrid Scrolling

  •  patrick.muellner-1p said 1 year ago:

    Hi.

    I have a normal DataGrid with one column (DataGridTextColumn)

    CanUserRemoveRows="True" Margin="0,3,0,0" ItemsSource="{Binding LayoutClient.ListenElemente}">


    But if my text is very long I don´t have a Scroll Viewer in my DataGrid.

    Regards

  •  C1_UpkarS71p said 11 months, 3 weeks ago:

    Sorry, I am unable to reproduce this. What is the parent container holding the datagrid?
    If possible, please post a small sample that shows the issue.

    Regards

  •  patrick.muellner-1p said 11 months, 3 weeks ago:

    Here is the sample.
    You can write as long as you want but there is no scrollviewer.

    Attachments:
    You must be logged in to view attched files.
  •  C1_UpkarS71p said 11 months, 3 weeks ago:

    Hi,

    Thanks for the sample.
    C1DataGrid (or any datagrid) shows the scrollbars on the basis of the columns. So, if the columns are out of view, the grid will automatically show the scrollbar. Scrollbars does not works on the basis of a cell content and that is the issue here.
    If you want the scrollbars inside cell contents, perhaps, you can use a custom column (or a template one) and place a control which supports scrollbars (say a C1RichTextBox). C1RichTextBox will automatically show the scrollbars in a cell if the text is out of view.

    Regards

  •  patrick.muellner-1p said 11 months, 3 weeks ago:

    Hi.

    Thanks for you answer.

    But in my picture you see that vertical sroll is made automatic why the horizontal not?!?!

    Regards

    Attachments:
    You must be logged in to view attched files.
  •  C1_UpkarS71p said 11 months, 3 weeks ago:

    Vertical Scrollbar is enabled on the basis of rows. As I mentioned earlier, the horizontal scrollbar is enabled
    only when the columns are out of view. I believe that’s the default behavior of every datagrid. They wont make cell content scroll-able.

    Regards

  •  patrick.muellner-1p said 11 months, 2 weeks ago:

    But here in my picture it is out of view and is also doesn´t works.

    But there must be a solution for that problem. Because in our program we have these kinds of datagrid very often.

    Regards

    Attachments:
    You must be logged in to view attched files.
  •  C1_UpkarS71p said 11 months, 2 weeks ago:

    Why dont you set TextWrapping of the column to true (and RowHeight to Auto)? That will wrap the text in the cell.

  •  patrick.muellner-1p said 11 months, 2 weeks ago:

    Okay if this doesn´t works I must do this like this.

    Another question.

    In my picture you see a DataGrid. If I use the navigate with the Key Down the DataGrid don´t scroll with the selected item. Any idea?

    Regards

    Attachments:
    You must be logged in to view attched files.
  •  C1_UpkarS71p said 11 months, 1 week ago:

    It works fine for me in the online demo. Are you able to reproduce the issue in the online demo?

    http://demo.componentone.com/silverlight/controlexplorer/#DataGrid/See%20it%20in%20action

    Regards

  •  patrick.muellner-1p said 10 months, 4 weeks ago:

    At a normal DataGrid it work´s fine.

    But it is a little bit complicatetd. Because I work in my ViewModel with the SelectedIndex in the DataGrid. And so I have a handler on the keyDown and if it´s Up or Down then I change the selected index.

    So maybe this is the reason why it doesn´t works.

    But I need this in my ViewModel.

    Any idea what is missing that the datagrid scroll with the selected index.

    Regards

  •  C1_UpkarS71p said 10 months, 3 weeks ago:

    Patrick,

    Could you post a small sample that shows the issue?

    Regards

  •  patrick.muellner-1p said 10 months, 3 weeks ago:

    Hi.

    This is my view (ContentControl):

     <ContentControl IsTabStop="False" VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" 
                             HorizontalContentAlignment="Stretch" HorizontalAlignment="Stretch" 
                             Content="{Binding KontenAnzeigeVM}" Margin="0,5,0,0"/>
    

    This is the contentcontrol (DataGrid)

          <c1:C1DataGrid IsTabStop="False" x:Name="SachkontoGrid" 
                           SelectedIndex="{Binding BuchungenClient.SelectedIndexSachkonto, Mode=TwoWay}" 
                           ItemsSource="{Binding BuchungenClient.Sachkonten.View}" 
                           SelectedItem="{Binding BuchungenClient.SelectedSachkonto, Mode=TwoWay}">
             <c1:C1DataGrid.Columns>
                <c1:DataGridTextColumn Width="80" Header="Kto. Nr." Binding="{Binding Nummer, Converter={StaticResource KontonummerConverter}}"/>
                <c1:DataGridTextColumn Width="*" Header="Bezeichnung" Binding="{Binding Bezeichnung}"/>
                <c1:DataGridTextColumn Width="60" HorizontalAlignment="Center" Header="%" Binding="{Binding Steuersatz.Satz, Converter={StaticResource DecimalConverter}}"/>
                <c1:DataGridTextColumn Width="*" Header="Kennziffer" Binding="{Binding RWKennzeichen.Bezeichnung}"/>
                <c1:DataGridTextColumn Width="*" Header="Gliederung" Binding="{Binding Gliederung.Bezeichnung}"/>
             </c1:C1DataGrid.Columns>
    
          </c1:C1DataGrid>
    
    Is there a difference if the parent is a grid, stackpanel or a c1:dockpanel..
    
    Regards
    
  •  patrick.muellner-1p said 10 months, 3 weeks ago:

    You can close the issue. It deppends on the IsTabStop=False. And I also set a handler to my PropertyChanged for my SelectedIndex and there I work with the ScrollInto Sub from the DataGrid.

    Thanks

    Regards

    Answer
Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic.