Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
Cell Focus
posted

I have wingrid of two rows and two columns( i st column as like label 2nd column like text box )

i want always set the focus to cells of column 2 only

even when user select column 1 cell i want it to focus column 2 cell only

hw n where i hv to code

 

Parents
No Data
Reply
  • 469350
    Offline posted

    Hi,

    Disabling column 0 and enabling column 1 is pretty easy. Here's a KB article that will show you how:

    HOWTO:How can I make a grid or a column, row, or cell in the UltraWinGrid disabled or read-only?

    You will probably also want to set the TabStop property on Column 0 to false, so that the tab key skips over that column.

    To make it so that clicking on the first column actually activates the second column and puts it into edit mode is a tiny bit trickier. For that, you will have to write a little bit of code.

    There are a number of approaches you could take, but here's some sample code that works well for me:


            private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
            {
                UltraGridLayout layout = e.Layout;
                UltraGridBand band = layout.Bands[0];

                band.Columns["Column 0"].CellActivation = Activation.NoEdit;
                band.Columns["Column 0"].TabStop = false;
            }

            private void ultraGrid1_AfterCellActivate(object sender, EventArgs e)
            {
                UltraGrid grid = (UltraGrid)sender;
                UltraGridCell activeCell = grid.ActiveCell;
                if (grid.ActiveCell != null &&            
                    grid.ActiveCell.Column.Key == "Column 0")
                {
                    grid.PerformAction(UltraGridAction.NextCellByTab);
                }
            }

     

Children
No Data