Hi!
My goal is to increment and decrement cell values by up and down keys.
My attached project achieves this.
I now want to increment all selected cells in a column to increment and decrement by same amount by the key,
Can you help me or just alter my project to achieve this.
Thanks
R K Verma
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Rakesh,
Thank you for your message.
I have modified your sample based on your requirements, and now it works as expected here. Please refer to the attached project, and let me know if this solution is suitable.
Thanks,
Svetlana
Hi Svetlana,
Thanks,
I guess we need to make the following changes;
I will appreciate if you can tell me how to do that.
This may be trivial but I am stuck here.
Thanks
R K Verma
Hi Rakesh,
If you wish to change values only in selected rows, you need to iterate through the selected rows and set appropriate cells' values manually. To access the selected rows, use the GridView.GetSelectedRows method.
We hope that you find this information helpful.
Thanks,
Svetlana
Hi!
I am really lost at this one. Just can't get it right.
Pls help
bool needChangeValue = true;
private void gridView1_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
{
ArrayList rows = new ArrayList();
for (int i = 0; i < gridView1.SelectedRowsCount; i++)
{
if (gridView1.GetSelectedRows()[i] >= 0)
rows.Add(gridView1.GetDataRow(gridView1.GetSelectedRows()[i]));
}
if (!needChangeValue) return;
if (e.Column.FieldName == "dx")
{
needChangeValue = false;
foreach (int row in gridView1.GetSelectedRows())
{
if (row != e.RowHandle)
gridView1.SetRowCellValue(row, e.Column, e.Value);
}
needChangeValue = true;
}
}
Thanks in advance
R K Verma
Hi Rakesh,
Attached is a sample, illustrating this approach in action. Please review it, and let me know if you need any further assistance.
Thanks,
Svetlana
Hi Svetlana!
Thak you.
That solves my problem!
Thanks again!
R K Verma
Thanks
Hi Rakesh,
Please do not hesitate to contact us in case of any difficulty. We will be happy to help you resolve any problem! :)
Thanks,
Svetlana