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
Hi,
Looks like I can't use Week, Hour, Minute and Second as a step for QueryableDateTimeGroupDescription, it is not implemented yet?
Alex

Hi
I have a column with multiple data types. I'm using the EditorRequired event to set the editor as a RadDateTimeEditor or RadDropDownListEditor using the code below. This mostly works but I have two problems.
1. With the country dropdown, I set dropDownStyle to DropDown. The editor allows me to type in any value but if the value is not one of the items in the list, as soon as I exit the cell the value disappears.
2. With the RadDateTimeEditor, I set the customFormat to "d" but when I select a value and exit the cell, it's showing the time as well as the date. How do I get it to show date only?
Private maritalStatuses() As String = {"Married", "In a De Facto Relationship", "Interdependent Relationship", "Engaged", "Separated", "Divorced", "Widowed", "Never Married"}
Private Countries() as String = {"", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola"}
Private Sub dgv_EditorRequired(sender As Object, e As EditorRequiredEventArgs) Handles dgv.EditorRequired
If dgv.CurrentColumn.Name = "ImportValue" Then
Select Case dgv.CurrentRow.Cells("EditorType").Value
Case radEditorType.DatePicker
Dim editor As RadDateTimeEditor = New RadDateTimeEditor
editor.CustomFormat = "d"
e.Editor = editor
Case radEditorType.CountryDropDown
Dim editor As New RadDropDownListEditor
editor.DropDownStyle = RadDropDownStyle.DropDown
DirectCast(editor.EditorElement, RadDropDownListEditorElement).DataSource = Countries
DirectCast(editor.EditorElement, RadDropDownListEditorElement).AutoCompleteMode = AutoCompleteMode.SuggestAppend
e.Editor = editor
Case radEditorType.MaritalStatusDropDown
Dim editor As New RadDropDownListEditor
DirectCast(editor.EditorElement, RadDropDownListEditorElement).DataSource = maritalStatuses
editor.DropDownStyle = RadDropDownStyle.DropDownList
e.Editor = editor
End Select
End If
End Sub
