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
or how i can enable edit mode on cell selection or cell having focus???
regards
Hello,
I was wondering if this issue has been resolved yet? Are you using the latest hot fix?
Thanks
I'm having the same issues. Is there an example of how to prevent users from selecting read only cells? I have 5 columns in a grid. Only one of those columns is editable. I want the navigation to only allow them to move to editable fields. What's the best way to achieve this?
Thanks!
There are a few ways to do this. It depends on how you have cells to be read-only.
One simple way to prevent a row (record) from being selected is to set RecordActivatingEventArgs.Cancel to true in an event handler for the RecordActivating event. In this handler you can query if any of the cells are read-only (AllowEdit == false).
If you have a cell which will always be read-only, if you make the property's setter method private the field will be read-only and un-editable. However, the user can still select the row (but not the cell). Or you can set the AllowEdit property for a cell and a record to true to make the cell or entire record read-only.
Let me know if this helps.
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?
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.
Thank you very much it was excellent ,I was looking for this,