Hi,
I have been trying to override CellFormatting to reformat a string value to look like 2 labels, one above the other (in the same cell) e.g.:
Freddy Smith (standard font)
On the phone (smaller font)
To do this I have been trying to create 2 RadHostControls, each one hosting a Label control and using .Location. .MaxSize etc properties to try to position the 2 labels (or their host controls) within the cell.
But somehow the first RadHostControl seems to take over all the spacein the cell (If I put the background to red I can see it occupies the whole cell).
Do you have any example where you have used multiple labels?
Many thanks.
(Using Q1 2016)
Hello, I have a custom column, that is bound to a custom type, the custom type is a complex type, that have a (public string Display) property, that is the one I wish to use to filter the grid.
The excel like filter is working, maybe because the compex type have a "tostring" method, i attach a screenshot of the grid.
The standard filter is not working instead. All the filters are disabled. How can I make the filter cell to work with the complex type? I think i have to create a new filter cell descending from Telerik.WinControls.UI.GridFilterCellElement
then on my custom column:
public
override
Type GetCellType(GridViewRowInfo row)
{
if
(row
is
GridViewDataRowInfo)
{
return
typeof
(LookupGridColumnElement);
}
else
if
(row
is
Telerik.WinControls.UI.GridViewFilteringRowInfo)
{
return
typeof
(LookupGridColumnFilterElement);
}
return
base
.GetCellType(row);
}
Is that the correct way? What do i need to override on my filter cell to let it work as if it were bound to a string field?
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.