or
void AllControls_ScreenTipNeeded(object sender, ScreenTipNeededEventArgs e) |
{ |
RadOffice2007ScreenTipElement screenTip = new RadOffice2007ScreenTipElement(); |
Control o = sender as Control; |
string sHelp = "This is help text for " + o.Name; |
screenTip.CaptionLabel.Text = string.Empty; |
screenTip.MainTextLabel.Text = sHelp; |
e.Item.ScreenTip = screenTip; |
} |
Private Sub rgvLines_CellBeginEdit(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellCancelEventArgs) Handles rgvLines.CellBeginEdit |
Select Case e.ColumnIndex |
Case rgvLines.Columns("MFG_ENTITY_ID").Index |
Dim lineCategoryTypeId As Integer |
Dim lineCategoryShortName As String = Nothing |
'Get the Line Category short name |
lineCategoryTypeId = CType(rgvLines.CurrentRow.Cells("LINE_CATEGORY_TYPE_ID").Value, Integer) |
lineCategoryShortName = GlobalMethods.GetTypeDefShortNameForTypeID(lineCategoryTypeId) |
If lineCategoryShortName = AppDefs.LineCategoryShortName.Group |
e.Cancel = True |
End if |
End Select |
End Sub |
This all works fine but the problem that I am having is that if the user has tabbed into this cell, then focus still stays with the cell that editing was cancelled for. The default behavior is for tabbing to skip over read-only columns. So once I cancel the CellBeginEdit event, how can I get to the next editable cell? Is it possible to simulate the tab key press programmatically?
Thanks,
Sean
// Adding Row On Master |
GridHdr.Rows.AddNew(GridHdr.Rows.NewRow()); |
// If new row is first row current row being null then i`m changing it. |
if (GridHdr.CurrentRow == null) |
GridHdr.CurrentRow = GridHdr.Rows[0]; |
// Filling Hdr Primerykey |
GridHdr.CurrentRow.Cells["pkID"].Value = HdrID; |
GridItm.Rows.AddNew(GridItm.Rows.NewRow()); |
// On DetailGrid current row, if is first row thats not null |
if (GridItm.Row.Count == 1) |
GridItm.CurrentRow = GridItm.Rows[0]; |
// Filling Itm PrimeryKey |
GridItm.CurrentRow.Cells["pkID"].Value = ItmID; |
// Filling Itm FKey |
GridItm.CurrentRow.Cells["fkHdrID"].Value = HdrID; |