I'm using Telerik.WinControls.GridView version 2012.2.912.40.
I validate a cell value in cell validating event.
I set e.Cancel = true in CellValidating event and then delete row of that cell with a command cell click event.
when the gridview's row count reach to zero and double click the gridview error occur "Exception thrown: 'System.NullReferenceException' in Telerik.WinControls.GridView.dll".
private void gvStockItemDetail_CellValidating(object sender, CellValidatingEventArgs e)
{
if (!string.IsNullOrEmpty(Convert.ToString(e.Row.Cells["Stock ID"].Value)) && column.Name == "Quantity")
{
if (Convert.ToDecimal(string.IsNullOrEmpty(Convert.ToString(e.Value)) ? 0 : e.Value) <= 0)
{
e.Cancel = true;
e.Row.Cells["Quantity"].BeginEdit();
e.Row.ErrorText = BOL_Global_Message.STOCK.Msg_Quantity;
}
else
{
e.Row.ErrorText = string.Empty;
}
}
}
private void gvStockItemDetail_CommandCellClick(object sender, EventArgs e)
{
if (gvStockItemDetail.CurrentRow.Index >= 0)
{
gvStockItemDetail.Rows.RemoveAt(gvStockItemDetail.CurrentRow.Index);
}
}
Collapsible Panels Controls Container is being focused on pressing ENTER key, however i have already set the following properties
Focusable = false
TabStop = false
but focus is being transfer and tab is being stop
can anybody guide what needs to be done here
Regards

Hi
How I can do to make the tab order do not appear in my radform radlabels? Please see the attached image.
Thanks
Angel
Hello there,
I'm trying to implement a basic barcode scanner into my winforms application with radGridView. I'd like to search the GridView using this barcode scanner, so I have to fill the searchbox programatically. This is successful: I scan a code, it appears in the box. I have to use the Form's KeyPreview property set to TRUE and the Form's KeyPress event (because the scan ends as soon as the scanner send a NewLine character). Here's the code:
private string qrCode=string.Empty;
private void Form1_KeyPress(object sender, KeyPressEventArgs e)
{
qrCode+=e.KeyChar;
if (e.KeyChar == (char) Keys.Return)
{
StartSearch();
}
}
private void StartSearch()
{
GridViewSearchRowInfo searchRow = this.grdMyGridView.MasterView.TableSearchRow;
searchRow.SearchProgressChanged += mySearchResult;
searchRow.Search(qrCode);
qrCode=string.Empty;
}
private void mySearchResult(object sender, SearchProgressChangedEventArgs e)
{
Console.WriteLine("Results: " + e.Cells.Count);
}
My problem is, that I always get 0 results. The searchbox has the search string, this is no problem. If I type this string manually into this box, I get results perfectly. I want my GridView to show the results of scanned strings. Is this possible?
Thanks again for your help!
Attila


I need to change the background color for input type controls (Textbox, etc...) when their property for ReadOnly is equal to True. Currently, it stays white and the font is bold. I'm new to VSB. I watched the videos and looked through the documentation, but I didn't see how to set the background color based on a control's ReadOnly property state. Is this possible? and if so, how is this done in VSB?
Thanks!
Hello!
I have a problem updating my sql db with my radGridView after successful binding. One of my sql column has 'bit' type, so the radGridView has a column with checkboxes. After I check/uncheck one of the checkboxes, it doesn't update my SQL unless I select another cell. Is there any solution to this problem? I use this event:
private void radGridView1_CellValueChanged(object sender, GridViewCellEventArgs e)
{
itemsTableAdapter.Update(telerikDataSet);
ordersTableAdapter.Update(telerikDataSet);
}
(I use table hierarchy. 'Orders' table is the parent, 'Items' table is the child. This is ok. I managed to solve that if I check the checkbox in the parent, all its child checkboxes will be checked too). This way:
private void radGridView1_ValueChanging(object sender, ValueChangingEventArgs e)
{
if (radGridView1.SelectedRows[0].Cells[3].ColumnInfo.HeaderText == "Closed")
{
if (radGridView1.SelectedRows[0].Cells["Closed"].IsCurrent)
{
foreach (GridViewRowInfo item in radGridView1.SelectedRows)
{
GridViewHierarchyRowInfo hierarchyRow = item as GridViewHierarchyRowInfo;
if (hierarchyRow != null)
{
GridViewInfo currentView = hierarchyRow.ActiveView;
foreach (GridViewInfo view in hierarchyRow.Views)
{
hierarchyRow.ActiveView = view;
foreach (GridViewRowInfo row in hierarchyRow.ChildRows)
{
radGridView1.ValueChanging -= radGridView1_ValueChanging;//without this getting infinite loop...
row.Cells[4].Value = e.NewValue;
ordersTableAdapter.Update(telerikDataSet);
itemsTableAdapter.Update(telerikDataSet);
radGridView1.ValueChanging += radGridView1_ValueChanging;
}
}
hierarchyRow.ActiveView = currentView;
}
}
}
}
}
Of course every other fields are working fine when I edit them: as soon as I hit enter, it updates SQL. But checkbox doesn't need enter...
Thanks for your help.

I have a listview with custom listitems that include a radButtonElement. How do I change the backcolor of the button? I've tried
Me.MatchButtonElement.ButtonFillElement.BackColor = Color.LightGreen
Me.MatchButtonElement.ButtonFillElement.BackColor2 = Color.LightGreen
Me.MatchButtonElement.ButtonFillElement.BackColor3 = Color.FromArgb(122, 223, 136)
Me.MatchButtonElement.ButtonFillElement.BackColor4 = Color.FromArgb(142, 237, 143)
and various other approaches but nothing has worked so far.

Please let me know where I am going wrong!
I've tried many ways, but for some reason when I test my maskedit field, I can't type anything in. No values are displayed as I type and the IFrame cursor doesn't move as I type. I can only Tab off the field.
Input: 1 - 999
-----------------------------
Mask: nnn
Type: Numeric
Prompt Char: 0
---------------------------
On line 7 below, the field doesn't get set to "001"
01.Private Sub mtxtDaysElapsed_Validating(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles mtxtDaysElapsed.Validating02. 'between 1 and 999 exclusive03. Dim nDaysElapsed = 004. 05. Try06. If mtxtDaysElapsed.Value = "" Or mtxtDaysElapsed.Value = "0" Then07. mtxtDaysElapsed.Value = "001"08. End If09. If Integer.TryParse(mtxtDaysElapsed.Value, nDaysElapsed) Then10. recPoVenmst.LateCutoffDays = nDaysElapsed.ToString11. Else12. e.Cancel = True13. End If14. Catch ex As Exception15. 'error16. End Try17.End Sub