Focusing Newly add Record.

I am doing some what mapping for data , in that when i mapped a newly mapped data will store in new grid . What should i do if i want to get focus on newly added row in my grid..

5 Replies

AD Administrator Syncfusion Team January 30, 2006 12:15 PM UTC

Hi Vihar, The Grid.CurrentCell.MoveTo(GridRangeInfo.Row(rowIndx)) will move the focus to a particular row. I have attached a sample which, moves the focus to the newly added/inserted row. Please refer the link for GridGroupingControl. If you are looking for something else please let us know. Regards, Calvin

GDBG.zip


VI vihar January 30, 2006 01:48 PM UTC

Thanks For Your Reply . But its not working for GGC. I want a newly added row in focus.though its get focused but it is not coming in to view. I have to scroll down the grid for getting newly added record in to view. How can i scroll the scrollbar automatecally that newly added record will come in to View.... Thanks Vihar.. >Hi Vihar, > >The Grid.CurrentCell.MoveTo(GridRangeInfo.Row(rowIndx)) will move the focus to a particular row. I have attached a sample which, moves the focus to the newly added/inserted row. Please refer the link for GridGroupingControl. > >If you are looking for something else please let us know. > >Regards, >Calvin

GDBG.zip


ST stanleyj Syncfusion Team January 30, 2006 01:57 PM UTC

Hi Vihar, You can use CurrentCell.ScrollInView or the overloaded fashion of MoveTo which has an option to set through GridSetCurrentCellOptions and that is shown in the sample. this.gridDataBoundGrid1.CurrentCell.ScrollInView(); this.gridDataBoundGrid1.CurrentCell.MoveTo(GridRangeInfo.Row(ind),GridSetCurrentCellOptions.ScrollInView); Best regards, Stanley


VI vihar January 30, 2006 02:52 PM UTC

hi Stanley.Sorry to say but your ans did not help me . I am Doing All this thing in SourceListListChangedCompleted event of grid. Ao As new row will add this event eill fire and i want to do the focusing, i did this many thing .. GridGroupingControl1.Table.Records[e.NewIndex+4].SetCurrent(); But this is just making the new row focused but not getting it in view ,, Then According to your reply I tried GridGroupingControl1.TableControl.CurrentCell.MoveTo(GridRangeInfo.Row(e.NewIndex+4),GridSetCurrentCellOptions.ScrollInView); But This is also not Working ... GridGroupingControl1.TableControl.CurrentCell.ScrollInView(); I tried This also But No Result Again .. Do u have any other ides... >Hi Vihar, > >You can use CurrentCell.ScrollInView or the overloaded fashion of MoveTo which has an option to set through GridSetCurrentCellOptions and that is shown in the sample. > >this.gridDataBoundGrid1.CurrentCell.ScrollInView(); > >this.gridDataBoundGrid1.CurrentCell.MoveTo(GridRangeInfo.Row(ind),GridSetCurrentCellOptions.ScrollInView); > >Best regards, >Stanley


ST stanleyj Syncfusion Team January 30, 2006 03:22 PM UTC

Hi Vihar, Sorry, I was addressing to GDBG again. Can you try adding Update() to the sample you saw in the forum thread mentioned above. To the else block in the button handler dt.Add(o); this.gridGroupingControl1.DataSource = null; this.gridGroupingControl1.DataSource = dt; this.gridGroupingControl1.Update(); Best regards, Stanley

Loader.
Up arrow icon