Tabbing GridViewDataColumn

6 posts, 0 answers
  1. Daniel
    Daniel avatar
    3 posts
    Member since:
    Oct 2014

    Posted 14 Oct 2014 Link to this post

    I'm using a RadGridview with 2 columns of GridViewDataColumns and DataTemplate (TextBox, ComboBox). I need 2 tab switches to select the control of the cell.
    How can I change it to 1 tab?
  2. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 14 Oct 2014 Link to this post

    Hi Daniel,


    Thank you for contacting us. 

    You may set EditTriggers property of a column (or the entire RadGridView) to CellClick

    If you placed these controls within CellTemplate, you could define your custom column.
    Once the corresponding cells is being tabbed to, just focus the TextBox or the ComboBox elements. 
    I'm attaching you small sample demo, which illustrates the second approach. 

    Hope this helps. 

    Regards,
    Vanya Pavlova
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. Daniel
    Daniel avatar
    3 posts
    Member since:
    Oct 2014

    Posted 14 Oct 2014 in reply to Vanya Pavlova Link to this post

    Hi Vanya,
    thanks for your reply, I can't find the example?
  4. Vanya Pavlova
    Admin
    Vanya Pavlova avatar
    2019 posts

    Posted 14 Oct 2014 Link to this post

    Hi Daniel,


    The attached .zip file, should be visible now. 

    Please excuse us for any inconvenience caused. 


    Regards,
    Vanya Pavlova
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  5. Daniel
    Daniel avatar
    3 posts
    Member since:
    Oct 2014

    Posted 15 Oct 2014 in reply to Vanya Pavlova Link to this post

    Hello Vanya,
    thanks for the expample, but it doesn't work for my implementation:
    That's my current Implementation:

    <telerik:GridViewDataColumn Header="Position" Width="*" >
                            <telerik:GridViewDataColumn.CellTemplate>
                                <DataTemplate>
                                    <Nominal:DoubleUpDown Value="{Binding Position, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True,
                                                      ValidatesOnNotifyDataErrors=True, ValidatesOnDataErrors=True}"
                                                      Style="{StaticResource DoubleValidationErrorStyle}">
                                        <i:Interaction.Triggers>
                                            <prism:InteractionRequestTrigger SourceObject="{Binding  PositionSelectionRequest, Mode=OneWay}">
                                                <prism:PopupWindowAction IsModal="False" CenterOverAssociatedObject="True">
                                                    <prism:PopupWindowAction.WindowContent>
                                                        <inf:ItemSelectionView />
                                                    </prism:PopupWindowAction.WindowContent>
                                                </prism:PopupWindowAction>
                                            </prism:InteractionRequestTrigger>
                                            <i:EventTrigger EventName="LostFocus">
                                                <i:InvokeCommandAction Command="{Binding RaisePositionSelectionCommand}"  />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Nominal:DoubleUpDown>
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellTemplate>
                            <telerik:GridViewDataColumn.CellEditTemplate>
                                <DataTemplate>
                                    <Nominal:DoubleUpDown Value="{Binding Position, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True,
                                                      ValidatesOnNotifyDataErrors=True, ValidatesOnDataErrors=True}"
                                                      Style="{StaticResource DoubleValidationErrorStyle}">
                                        <i:Interaction.Triggers>
                                            <prism:InteractionRequestTrigger SourceObject="{Binding  ItemPositionSelectionRequest, Mode=OneWay}">
                                                <prism:PopupWindowAction IsModal="False" CenterOverAssociatedObject="True">
                                                    <prism:PopupWindowAction.WindowContent>
                                                        <inf:ItemSelectionView />
                                                    </prism:PopupWindowAction.WindowContent>
                                                </prism:PopupWindowAction>
                                            </prism:InteractionRequestTrigger>
                                            <i:EventTrigger EventName="LostFocus">
                                                <i:InvokeCommandAction Command="{Binding RaisePositionSelectionCommand}"  />
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Nominal:DoubleUpDown>
                                </DataTemplate>
                            </telerik:GridViewDataColumn.CellEditTemplate>
                        </telerik:GridViewDataColumn>

    If i click into the cell the BeginningEdit event shall be triggered. If I tab to another cell, the control of cell shall be focused and the BeginningEdit event shall be triggered. 
  6. Boris
    Admin
    Boris avatar
    276 posts

    Posted 15 Oct 2014 Link to this post

    Hello Daniel,

    In order to trigger the BeginningEdit event of RadGridView, you will need to enter edit mode state of the cell. That will not happen if you have an editor control in your CellTemplate, because it will get the focus instead of the editor defined in your CellEditTemplate. There are several ways in which you can deal with this issue:
    1) Use the default CellTemplate, which is a TextBlock bound to the DataMemberBinding property of the current column.
    2) Still use your DoubleUpDown control as a CellTemplate. However, you will need to make sure you will enter into edit mode state of the editor defined in CellEditTemplate and not the one in CellTemplate. Thus ensuring that the BeginningEdit event of RadGridView will be triggered. In order to do that you will need to disable the DoubleUpDown in the CellTemplate, by setting it's IsEnabled property to "False".
    3) Another possible way to go about this issue is not to rely on the BeginningEdit event of RadGridView and use only a CellTemplate. Then you can add a handler for a specific to your needs event of the DoubleUpDown and implement your logic there. In order to make sure that a client will not enter in the edit mode state of the cell, you can set the IsReadOnly property of that column to "True".

    I hope this helps.

    Regards,
    Boris Penev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top