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
374
ColumnStyle.DateTime and cursor position
posted

I have a column using the style = Infragistics.Win.UltraWinGrid.ColumnStyle.DateTime

it basically shows the date and time in the same cell and both are editable.  The date is editable through a calendar dropdown that allows easy click to select operation.  When a new date is selected, the time seems to default to 12:00AM, and the entire cell's contents are highlighted.

Is there a way to move the cursor into position just before the first digit of the time portion to allow easier editing?  if possible, I want to be able to do this when a date is entered into a blank cell, or when a cell with data is selected.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

     Hi,

        It think you could acheive this in the AfterCellListCloseUp event. Just as a test, I tried this:

       
            private void ultraGrid1_AfterCellListCloseUp(object sender, CellEventArgs e)
            {
                if (e.Cell.Column.DataType == typeof(DateTime))
                {
                    e.Cell.SelStart = 5;
                }
            }

        Obviously, 5 is just an arbitrary value here. You would want to examine the Text property of the cell and determine the right place to put the cursor.  

     

Children