We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

rowEnter event

Hey,
I'm using gridDataBoundGrid.
I added to the grid some columns, and configured the dataSource of the grid.
For each column I configured its suitable mappingName (like the cols in the dataTable), except of the last column. I used modelQueryCellInfo event in order to duplicate some data from other column to it. The problem is that the rowEnter event doesn't jump when I click on a cell in the last column because I added to it unique mapping name that doesn't have any relation to the dataSource.

I need that this(rowEnter) event will jump, and no other event.

I also tried to add a column to the dataTable (dataSource) which its name is the name of the unique mappingName, but it's also doesn't help.
I don't want to configure the dataTable from beginning to have the last column, and if it is possible I don't want to add at all any additional column to the dataTable.

Can you help me ?

thanks,
Yoni


3 Replies

JS Jeba S Syncfusion Team January 31, 2008 05:31 PM UTC

Hi Yoni,

Sorry for the delay in response.

You can make the RowEnter to fire for the Unbound Column by handling the CurrentCellMoved. In the event handler please use the following snippets:


private void gridDataBoundGrid1_CurrentCellMoved(object sender, GridCurrentCellMovedEventArgs e)
{
GridDataBoundGrid grid = sender as GridDataBoundGrid;
GridCurrentCell cc = grid.CurrentCell;
if (cc.MoveToRowIndex != cc.MoveFromRowIndex)
{
int col = cc.ColIndex;
grid.CurrentCell.MoveTo(cc.RowIndex, 1);
grid.CurrentCell.MoveTo(cc.RowIndex, col);
}
}


Please refer the sample and let us know if this helps:
http://websamples.syncfusion.com/samples/Grid.Windows/F71359/main.htm

Thank you for your interest in Syncfusion Products.

Regards,
Jeba.




YO Yoni January 31, 2008 08:28 PM UTC

Hey again,
First of all, why the rowEnter event doesn't jump when I click on a gridBoundColumn that its mappingName isn't related to nothing in the dataTable ? Why do I have to register to an event that doesn't have a connection to rowEnter event ? The event have to jump by changing the row place.

Second, why when I configure new dataColumn for the dataTable with the unique mappingName of the gridBoundColumn then the rowEnter event doesn't also jump ?

Third, can you please tell me how can I insert dataColumn with the unique mappingName of the gridBoundColumn and the rowEnter event will jump ?

Thanks a lot,
Yoni



JS Jeba S Syncfusion Team February 7, 2008 05:29 AM UTC

Hi Yoni,

Reason for RowEnter event not firing for UnboundColumn with unique mappingName

Even though the unbound column is bound with a MappingName it is not related to the underlying datasource.That means there is no row releted to unboundcell.

If you want to fire the RowEnter event for unbound column then derive the GridDataBoundGrid and override the OnCurrentCellActivating method to call the RowEnter event.


GridRowEventArgs ce = new GridRowEventArgs(e.RowIndex);
this.OnRowEnter(ce);


Please check the RowIndex and call the above code for unbound column.

Kindly let us know if you need any further assistance.

Best Regards,
Jeba.



Loader.
Live Chat Icon For mobile
Up arrow icon