Telerik Forums
UI for WinForms Forum
14 answers
1.5K+ views
Hello,

i am having frmHome.vb with radgridview control, i am opening frmHome.vb form in RadDoc tab in frmMainapplication.vb form.
data is binded to gridview, in grid view there is on commanbutton column. by clicking the command button i am opening frmTagDetails.vb in tab. in formDetails i am having one button. if i click on that button a new form is opend to with two radion buttons.
after selectiecion one of the option from it and clicking on OK button. and record is inserted in database table. testUser.
after inserting record in testuser i need to update the radgridview. automatically and new user detals must be displayed. my
frmhome.vb form is already open.

Dim objfrmHome As New frmHome
  
objfrmHome.gridViewHome.DataSource = Nothing
  
AssetBusinessLogic.GetDataToFillGridView(_assetChecklist.Asset.Project.ProjectID)
  
objfrmHome.gridViewHome.MasterTemplate.DataSource = AssetBusinessLogic.aTLi
  
objfrmHome.gridViewHome.Refresh()
  
objfrmHome.gridViewHome.MasterTemplate.Refresh()
  
objfrmHome.gridViewHome.MasterTemplate.AutoSizeColumnsMode = GridViewAutoSizeColumnsMode.Fill
  
i am using this code but the while loading the details from database i am getting the lattest details.
but after binding to grid the grid is not refreshed.

i have stucked over here.

Thanks in advance
Emanuel Varga
Top achievements
Rank 1
 answered on 14 Oct 2010
1 answer
121 views
Hello,
I experience poor performance in hierarchical RadGridView which is bounded to BindingSource object.

Using bindingSource.ResetBindings(false) in this grid lasts almost 2 seconds (in normal grid it lasts only 0,1sec).
Relation is created in designer (not programmatically). There are 5k rows in BindingSource. Grid is bounded to BindingSource in designer (radGridView.DataSource = bindingSource);

Can you give any clues how can I make bindingSource.ResetBindings() faster ?
Richard Slade
Top achievements
Rank 2
 answered on 14 Oct 2010
1 answer
119 views
Hello!

Is there any possibility to get  information about button clicked on chart item, because I need to show context menu if right button clicked.

For know I use following code:
private void  ActiveRegion_Click(object sender, RegionClickEventArgs args)
        {
            var fileId = Convert.ToInt32(args.Element.ActiveRegion.Attributes);
            _tableFilesBindingSource.Position = SearchFilesTableBindingSource(fileId);
            _isOnSomeSerieItem = true;
        }
...
 
 private void  _radChart1_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right && _isOnSomeSerie)
            {
                GetFileGridMenu().Show(_radChart1, e.X, e.Y);
                _isOnSomeSerieItem = false;
            }
        }

where _isSomeSerieItem is private filed.
Is there more correct way to do that?
Vladimir Milev
Telerik team
 answered on 14 Oct 2010
2 answers
104 views
 “Folder Tree” mode.
Private Sub Grid_CellBeginEdit(ByVal sender As Object, ByVal e As GridViewCellCancelEventArgs)
programName = DirectCast(Grid.Rows(e.RowIndex).Cells("program").Value, String)

with code in your example, i could not get the correct cell value because e.rowindex somehow is the wrong row... due to rearranging in tree mode...

It took me few hours to find out that your e.rowindex is reference to the non-tree mode grid... so how can I get user interaction during the tree mode?

Also your support ticket page is 404 error.

Thanks,
J.
Alexander
Telerik team
 answered on 14 Oct 2010
3 answers
185 views
Hello Telerik Team,

I am facing a rather strange problem with the telerik dropdownlist and listbox.

I am developing an application which relies on a couple of nonmanaged driver-dlls. As soon as I load one particular dll, after that I cannot instanianate ANY telerik dropdownlist or listbox. As soon as the controls ctor is called, an arithmeticexception is thrown. The call stack is as follows:

bei Telerik.WinControls.UI.RadScrollBarElement.get_ThumbLengthProportion()
bei Telerik.WinControls.UI.RadScrollBarElement.SetupThumb(Int32 newValue, Boolean thumbLocationOnly)
bei Telerik.WinControls.UI.RadScrollBarElement.set_Maximum(Int32 value)
bei Telerik.WinControls.UI.VirtualizedScrollPanel`2..ctor()
bei Telerik.WinControls.UI.RadListElement..ctor()
bei Telerik.WinControls.UI.PopupEditorElement.CreateChildElements()
bei Telerik.WinControls.UI.RadDropDownListElement.CreateChildElements()
bei Telerik.WinControls.RadElement.CallCreateChildElements()
bei Telerik.WinControls.RadElement.Construct()
bei Telerik.WinControls.RadElement..ctor()
bei Telerik.WinControls.RadItem..ctor()
bei Telerik.WinControls.UI.PopupEditorElement..ctor()
bei Telerik.WinControls.UI.RadDropDownListElement..ctor()
bei Telerik.WinControls.UI.RadDropDownList.CreateChildItems(RadElement parent)
bei Telerik.WinControls.RadControl.Telerik.WinControls.IComponentTreeHandler.CreateChildItems(RadElement parent)
bei Telerik.WinControls.RadControl.ComponentOverrideElementTree.CreateChildItems(RadElement parent)
bei Telerik.WinControls.RadControl.Construct()
bei Telerik.WinControls.RadControl..ctor()
bei Telerik.WinControls.UI.RadDropDownList..ctor()
bei SenseIT._4Dtwo.CatchIT.Forms.AddNewDevice.InitializeComponent() in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Forms\AddNewDevice.Designer.cs:Zeile 37.
bei SenseIT._4Dtwo.CatchIT.Forms.AddNewDevice..ctor() in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Forms\AddNewDevice.cs:Zeile 20.
bei SenseIT._4Dtwo.CatchIT.Controls.DeviceView.radButton1_Click(Object sender, EventArgs e) in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Controls\DeviceView.cs:Zeile 161.
bei System.Windows.Forms.Control.OnClick(EventArgs e)
bei Telerik.WinControls.RadControl.OnClick(EventArgs e)
bei Telerik.WinControls.UI.RadButton.ButtonElement_Click(Object sender, EventArgs e)
bei Telerik.WinControls.RadItem.OnClick(EventArgs e)
bei Telerik.WinControls.UI.RadButtonItem.OnClick(EventArgs e)
bei Telerik.WinControls.RadItem.DoClick(EventArgs e)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadItem.RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
bei Telerik.WinControls.RadElement.DoMouseUp(MouseEventArgs e)
bei Telerik.WinControls.ComponentInputBehavior.OnMouseUp(MouseEventArgs e)
bei Telerik.WinControls.RadControl.OnMouseUp(MouseEventArgs e)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei Telerik.WinControls.RadControl.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
bei System.Windows.Forms.Application.Run(Form mainForm)
bei SenseIT._4Dtwo.CatchIT.Program.Main() in E:\Projekte\es-tfs\ES.4Dtwo\ES.4Dtwo.Hydra\ES.4Dtwo.Hydra\SenseIT.4Dtwo.CatchIT\Program.cs:Zeile 21.
bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)
bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
bei System.Threading.ThreadHelper.ThreadStart()

Do you have any idea how I could work around this problem?

best regards

Ulrik
Stefan
Telerik team
 answered on 14 Oct 2010
15 answers
390 views
I have the following Grid structure:

MasterGridViewTemplate (dgTransactions) --> ChildGridTemplate1 (cSubCat)  --> ChildGridTemplate2 (cTrans)

I am populating each Template with Data but the ChildGridTemplate2 is not displaying any data - even though that the Datasource is populated with data.


Code snippet:
GridViewTemplate cSubCat = new GridViewTemplate(this.dgTransactions);
 
GridViewRelation relGridSubCat = new GridViewRelation(this.dgTransactions.MasterGridViewTemplate);
 
relGridSubCat.ChildTemplate = cSubCat;
relGridSubCat.ChildColumnNames.Add("CategoryType");
relGridSubCat.ParentColumnNames.Add("CategoryType");
 
 
this.dgTransactions.Relations.Add(relGridSubCat);
 
            this.dgTransactions.MasterGridViewTemplate.ChildGridViewTemplates.Add(cSubCat);
 
GridViewTemplate cTrans = new GridViewTemplate(this.dgTransactions);
 
             
GridViewRelation relSubCatTrans = new GridViewRelation();
relSubCatTrans.ChildTemplate = cTrans;
relSubCatTrans.ParentTemplate = this.dgTransactions.MasterGridViewTemplate.ChildGridViewTemplates[0];
relSubCatTrans.ChildColumnNames.Add("CategorySubType");
relSubCatTrans.ParentColumnNames.Add("CategorySubType");
 
             
this.dgTransactions.Relations.Add(relSubCatTrans);
 
cSubCat.ChildGridViewTemplates.Add(cTrans);
 
var sub = from x in this.CurrentTransactions
          select new { CategorySubType = x.CategorySubType, CategoryType = x.CategoryType };
 
            
             
 this.dgTransactions.DataSource = sub.Select(grp => new { grp.CategoryType }).Distinct().ToList(); ;
 
 
 cSubCat.DataSource = sub.Select(grp => new { grp.CategorySubType, grp.CategoryType }).Distinct().ToList();
 
 
cTrans.DataSource = this.CurrentTransactions.ToList();
Nikolay
Telerik team
 answered on 14 Oct 2010
14 answers
249 views
Hello,
               I want  to  chang  current  row  at  radgrid    .I  use  3 level  hierarchical  and  want  to  chang seleted  row  from     level  1  to  level 2  and  so on.


Alexander
Telerik team
 answered on 14 Oct 2010
2 answers
174 views
Hello,

I´m traying to use the AllowAddNewRow property of RadGridView but
i have an error when set to true this property.

The error ocurrs when you configures the grid with readonly columns property.
When you drag and drop the "Click here to add new row" cell to other readonly cell in diferent row.

this is my example

GridViewTextBoxColumn

 

txtEstatus = new GridViewTextBoxColumn();

 

txtEstatus.Name =

"Estatus";

 

txtEstatus.HeaderText =

"Estatus";

 

txtEstatus.ReadOnly =

true;

 

radGridView1.Columns.Add(txtEstatus);

 


GridViewTextBoxColumn
txtot = new GridViewTextBoxColumn();

 

txtot.Name =

"OT";

 

txtot.ReadOnly =

true;

 

txtot.HeaderText =

"OT";

 

radGridView1.Columns.Add(txtot);

radGridView1.AllowAddNewRow =

true;

 

radGridView1.AutoSizeColumnsMode =

GridViewAutoSizeColumnsMode.Fill;

 

radGridView1.Rows.Add((

new List<string> {"333","333","dd","dd" }).ToArray());

 



to resolve this error i have to set each cell for this row to readonly




The error says Message= "No se puede convertir un objeto de tipo 'Telerik.WinControls.UI.GridViewDataRowInfo' al tipo 'Telerik.WinControls.UI.GridViewNewRowInfo'.

"Unable to cast object of type 'Telerik.WinControls.UI.GridViewDataRowInfo' to type 'Telerik.WinControls.UI.GridViewNewRowInfo'.
Alexander
Telerik team
 answered on 14 Oct 2010
7 answers
165 views
Hi,
is there any way to shorten my validation code?? like using case, etc..???
I have been tried many ways to shortened it, but i got nothing but error because the parameter (ByVal e As Telerik.WinControls.UI.CellValidatingEventArgs)
here my code:

Private Sub TabelBuku_CellValidating(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellValidatingEventArgs) Handles TabelBuku.CellValidating
    Dim kolom = TryCast(e.Column, GridViewDataColumn)
    If ((TypeOf e.Row Is GridViewDataRowInfo Or (TypeOf e.Row Is GridViewNewRowInfo)) AndAlso (kolom IsNot Nothing) AndAlso (kolom.FieldName = "Tahun Terbit")) Then
        Dim nilai = DirectCast(e.Value, String)
        If (String.IsNullOrEmpty(nilai)) Then
            e.Cancel = True
            e.Row.ErrorText = "Tahun Terbit Belum Diisi"
            warningKesalahan(Color.LightYellow, Color.Red, "Tahun Terbit Belum Diisi!!")
        Else
            e.Row.ErrorText = String.Empty
            warningKesalahan(Color.Transparent, Color.LimeGreen, "Editor Data Buku")
        End If
    End If
    If ((TypeOf e.Row Is GridViewDataRowInfo Or (TypeOf e.Row Is GridViewNewRowInfo)) AndAlso (kolom IsNot Nothing) AndAlso (kolom.FieldName = "IdBuku")) Then
        Dim nilai = DirectCast(e.Value, String)
        If (String.IsNullOrEmpty(nilai)) Then
            e.Cancel = True
            e.Row.ErrorText = "ID Buku Harus Diisi"
            warningKesalahan(Color.LightYellow, Color.Red, "ID Buku Harus Diisi")
        Else
            e.Row.ErrorText = String.Empty
            warningKesalahan(Color.Transparent, Color.LimeGreen, "Editor Data Buku")
        End If
    End If
End Sub

Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
7 answers
396 views
I am trying to use an image on the buttons in GridCommandCellElement columns. How do I Zoom the image to fit the cell?
Emanuel Varga
Top achievements
Rank 1
 answered on 13 Oct 2010
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ListView
ComboBox and ListBox (obsolete as of Q2 2010)
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
PropertyGrid
Menu
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
CheckedDropDownList
ProgressBar
TrackBar
MessageBox
Rotator
SpinEditor
StatusStrip
CheckedListBox
LayoutControl
SyntaxEditor
Wizard
ShapedForm
TextBoxControl
Conversational UI, Chat
DateTimePicker
CollapsiblePanel
TabbedForm
CAB Enabling Kit
GroupBox
DataEntry
ScrollablePanel
ScrollBar
WaitingBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
Callout
ColorBox
PictureBox
FilterView
NavigationView
Accessibility
VirtualKeyboard
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BarcodeView
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Flyout
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
ToolbarForm
NotifyIcon
DateOnlyPicker
Rating
TimeSpanPicker
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
TimeOnlyPicker
+129 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?