Hi,
I am using XamDataGrid Express Edition.
I have two editable column in grid. I am binding XamTextEditor and its working fine.
Following customisation i want to do:... Plzzzz help me...
1. i want to make this XamTextEditor visible alwayz instead of UserClick on cell and its make visible.
2. User should be able to use Tab key to navigate editor in same record and only editable cells. right now if i use tab key its just focus on cell but not selecting textbox.
3. User can use arrow key up and down to move to next record and should be change value of editable part only.
4. user should not be able to select other non - editable cells...
Please help me on this....
tks
Shrenik
i am making the RecordActivatingevent Cancel = true. But then the cell activated event will also not fire.
Can you please provide the sample for same.
I have 5 columns any one of the cells will be editable. I cant mention the index (column number) as editable field. I want all the editable fields to be focused on tab and shift tab. And Arrow-Up and Arrow- down key event also.
Thank you
I've tried this implementation but got stuck in a problem... What if I am selecting a group of records instead of one by one?
Thing is that when I select lots of records using the Shift key the RecordActivating event will not fire. Just for the first and last selection. The records in the middle are not being evaluated. can u plz advise?
Thanks!
Hello,
You can use the CellActivated event and handle it appropriately to the AllowEdit property of the cell like this:
void xamDataGrid1_CellActivated(object sender, Infragistics.Windows.DataPresenter.Events.CellActivatedEventArgs e)
{if (e.Cell.Field.Settings.AllowEdit == false)
{xamDataGrid1.ExecuteCommand(DataPresenterCommands.CellNextByTab);e.Handled = true; }}
However, this will bring some complications with the Shift-Tabbing or activating the cell by mouse action.
Therefore, in this scenario it is best to use the ExecutedCommand event. Navigation in the grid is connected with the CellNextByTab and CellPreviousByTab Commands. I am attaching a sample project for this issue. In the project, the Age field is read only and it will be skipped by tab or shift-tab.
Here is the code for the ExecutedCommand event:
void xamDataGrid1_ExecutedCommand(object sender, Infragistics.Windows.Controls.Events.ExecutedCommandEventArgs e)
{
if (e.Command == DataPresenterCommands.CellNextByTab)
if (xamDataGrid1.ActiveCell.Field.Settings.AllowEdit == false)
xamDataGrid1.ExecuteCommand(DataPresenterCommands.CellNextByTab);
}
if (e.Command == DataPresenterCommands.CellPreviousByTab)
xamDataGrid1.ExecuteCommand(DataPresenterCommands.CellPreviousByTab);
Please let me know if you have any more questions on this.
i need to know which xamdatagrid(row,col) select with this event XamDataGrid1_CellActivated
XamDataGrid1_CellActivated
You can get the active cell from the XamDataGrid.ActiveCell property. The cell exposes Record.Index and Field.Index properties which you can use.