Setting focus to a particular screen object

Hi Greg,

If you click here, the option 150 will not show for you?

If it shows, please select 150, then close and open again the project.

Best Regards,
Tatsoft Team.

Thanks Eduardo. That did the trick :smiley:
It certainly isn’t something that I had considered … but I will be alert in future!

As I have indicated earlier … the real problem for me is that the essential coding elements remain extremely cryptic to me! For example the key code lines in your most recent example are:

Dim row As Xceed.Wpf.DataGrid.DataRow = DirectCast(grid.GridControl.DataGridObj.GetContainerFromIndex(index), Xceed.Wpf.DataGrid.DataRow)

@Tag.IsFocused = TConvert.[To](Of Integer)(row.Cells(0).IsKeyboardFocusWithin)

However, I would say that within this code I was totally unaware of the relevance of the Xceed, DirectCast, and GetContainerFromIndex functions. I am a systems engineer with experience building systems in a wide range of programming environments over many, many years … but I am finding the transition to .NET very challenging. My lack of training and experience with .NET isn’t your problem … but it is definitely impacting my evaluation of FactoryStudio :confused:

Can you recommend any training that might be particularly applicable to the FactoryStudio environment. I have looked at some on-line resources, but they are very general in coverage and give no insight into the detail required for sophisticated interface design.

Having said all of that, I really appreciate your efforts to assist, and am able to build on the examples you have provided.

Following your most recent example, I think I require only one more element to support my ideal grid navigation control. Building on that example … is there a method of directing focus to a nominated grid column or cell?

That is … rather than just determining if a particular column or cell is focused … how can you direct focus to a particular column or cell. If that is possible, then it is the final element I need in order to restrict navigation to the single column within the grid which is for data entry. For my application, all the other columns are for display only.

If you are able to assist that will be great, otherwise what I have achieved so far will almost certainly be adequate :slight_smile:

Hi Greg,

There is no a specific course for that, we use C# based on .NET and the most used command is to control some object, as we showed you, “TTextBox” can be replaced with any object and when we call this method it will open a list full of methods for using with this object:

image

For focusing a specific column or cell you can use the following code, in this example we put this action when a button is clicked, but you can change it according to your necessity:

The code behind this will be used in the button:

The DataGrid configuration will be this:
The field “Selected Index” is important for this.

Is this what you were looking for?

Best Regards,
Tatsoft Team.

Hi Eduardo.

The method you have provided works well for maintaining focus on a nominated column … so thankyou very much for that :slight_smile:

However, as usual there is a subsequent problem.
When the code you provided is used … although focus is maintained … you are unable to edit the cell which appears to be in focus.

That is, it appears that the cell has been locked from editing. So now I am trying to determine how this comes about … and hopefully find a way to avoid the problem.

Thanks again,
Greg

Hi Greg,

But as you can see in the video, we write “Test” in line 4. Isn’t it what you want?

Best Regards,
Tatsoft Team.

Hi Eduardo.

I worked out the cause of my problem.

I had been using a Handler for the grid GotFocus event to ensure focus remained on the column whenever the data grid row changed, as I knew from earlier experience that this event was triggered on row change.

However, it looks like the GotFocus handler was also activating on key strokes … which was preventing editing. I have now adopted a different method and editing works as expected.

I still have some refinements to make, but I think these should be manageable.

Thanks again.
Greg

Hi Greg,

That’s good, we hope we could help you. Let us know if you still have some questions please.

Best Regards,
Tatsoft Team.