Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
8189 | Oct 24,2003 10:47 PM UTC | Oct 25,2003 12:52 PM UTC | WinForms | 2 |
![]() |
Tags: GridControl |
private void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e) { GridCurrentCell cc = this.gridControl1.CurrentCell; if(cc.RowIndex == this.gridControl1.RowCount) { this.gridControl1.RowCount++; this.gridControl1[this.gridControl1.RowCount, 1].Text = "DefaultValue1"; this.gridControl1[this.gridControl1.RowCount, 2].Text = "DefaultValue2"; } }But if you want to add the new row as you end the editing on the first cell in the last row, you do run into this problem. In this case, you can avoid the problem by locking the currentcell as you add the row.
private void gridControl1_CurrentCellEditingComplete(object sender, System.EventArgs e) { GridCurrentCell cc = this.gridControl1.CurrentCell; if(cc.RowIndex == this.gridControl1.RowCount) { cc.Lock(); this.gridControl1.RowCount++; cc.Unlock(); this.gridControl1[this.gridControl1.RowCount, 1].Text = "DefaultValue1"; this.gridControl1[this.gridControl1.RowCount, 2].Text = "DefaultValue2"; } }2) I don't have an answer for your second question. From our point of view, we want the set of events to be rich enough that there is an appropriate one available to allow you to do the tasks you need to get done. And, if we miss one, we will try to add it if at all reasonable/possible.
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.