Telerik Forums
UI for WinForms Forum
7 answers
1.0K+ views
Hello,
I would like to have in my gridView a delete button(no commandButton) for each row added. 
When  i clicked on one of this buttons, i would like the corresponding row to be deleted.

This is what it does:
ICreate the button on cellFormatting and add an eventHandler


 Private Sub GridViewPrepack_CellFormatting(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.CellFormattingEventArgs) Handles GridViewPrepack.CellFormatting 


        


          If Not (e.CellElement.Children.Count > 0) Then  


                    Dim myButton As New RadButtonElement 


 


                    'Display style of the Image 


                   


                    if  CType(e.CellElement.ColumnInfo,GridViewDataColumn).FieldName = "Delete" 








                            AddHandler myButton.Click, AddressOf DeleteButton_Click 


 


                            'add the button to the cell 


                            e.CellElement.Children.Add(myButton) 


 


                       


                End If 


            End If 


 


    End Sub 

Now, i would like the row to be deleted when the delete button is clicked, but i don't know how.
I tried this, but it doesn't delete the right row
 Private Sub DeleteButton_Click(ByVal sender As Object, ByVal e As EventArgs) 
        GridViewPrepack.Rows.Remove(GridViewPrepack.CurrentRow) 
    End Sub 
.
can you help me?
Thank you
==: Shirya :==

Imo
Top achievements
Rank 1
 answered on 16 Jul 2012
1 answer
137 views
Dear Support,

We use RadGridView with Summaries rows and Parent Summaries rows. On loading all sum are correct. But when the user change a value in the grid, the summaries are updated but not the parent summaries rows.

I attached pictures showing the problem. AfterLoad is the gris after the form is loaded, and afterChange is the gris when I change the value of the first row from 75 to 65. Top Summaries and group summaries have updated but not the parent summaries.

Please advise,
Nadia
Jack
Telerik team
 answered on 16 Jul 2012
0 answers
230 views
Hello,

I looked sometimes for a solution to change the count of items displayed in the Popup of the RadDropDownListEditorElement.

My solution now is:

Use of EditorRequired event from RadPropertyGrid, Setting the editor to RadDropDownListEditor. Getting the EditorElement as RadDropDownListEditorElement and define the MinSize of Popup as follows:

RadDropDownListEditor editor = new RadDropDownListEditor(); 
RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement; 
  
element.Popup.MinimumSize = new System.Drawing.Size(element.Popup.MinimumSize.Width, 
                                        element.ItemHeight * 10); 
  
editor.DropDownStyle = Telerik.WinControls.RadDropDownStyle.DropDownList; 
e.Editor = editor;

where as 10 ist the count of items to be displayed.


Regards from Leipzig

Holger
Holger Boskugel
Top achievements
Rank 2
 asked on 16 Jul 2012
1 answer
282 views
Hi telerik

I have a toolwindow on the right, and i disabled the close button and window state button, but the close button and window state button re-appeared after the auto hide action.

Thanks
Nikolay
Telerik team
 answered on 16 Jul 2012
6 answers
117 views
Hello every one...
I use the groupdescriptor by smart tag and set the settings by wizards.
It works great and grouping well,but some times,without any reasons and without any execution of event,
the NullReferenceException thrown...and i don't know why
It's very bad...please help
Stefan
Telerik team
 answered on 16 Jul 2012
2 answers
128 views
Hi, i'm using radmenu with a few buttons, and submenus... This has happened to me 3 times. When i try to change the name of a item directly on the property window, not the item collection window, i get the error "The value can't be null. Parameter name objecttype":

en System.ComponentModel.TypeDescriptor.TypeDescriptionNode.GetRuntimeType(Type objectType)
en System.ComponentModel.TypeDescriptionProvider.GetRuntimeType(Type reflectionType)
en Microsoft.VisualStudio.Design.MultiTargetingContextProvider.GetRuntimeType(Type objectType)
en Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.GetFieldType(String fieldName, Type documentBaseType)
en Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.GetReferencedComponentType(String componentName, CodeTypeDeclaration codeTypeDecl, ITypeResolutionService loader, IDictionary& cache)
en Microsoft.VisualStudio.Design.Serialization.CodeDom.HandlesClauseManager.ParseHandlesClauses(CodeTypeDeclaration codeTypeDecl, Boolean updateCache)
en Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomParser.OnMethodPopulateStatements(Object sender, EventArgs e)
en System.CodeDom.CodeMemberMethod.get_Statements()
en System.ComponentModel.Design.Serialization.TypeCodeDomSerializer.Deserialize(IDesignerSerializationManager manager, CodeTypeDeclaration declaration)
en System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager manager)
en Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager serializationManager)
en Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32 fReload)
 
And now every time i open the designer i get this error.

Any help?
Thanks

Stefan
Telerik team
 answered on 16 Jul 2012
1 answer
101 views
im populating a data gridview from a sql table and once the information is in the grid view i want to take the average of the 5th row called TotalTime i need the average time it takes to build the product and put it in to a text box and put it in to a text box labeled Tb_AverageTime
my code so far
string _connStr = "Server = ESIDC2\\ALLORDERS,62800; User ID=sa; password=Sysadmin1;Database=ESIVENTURES";
            using (SqlConnection conn = new SqlConnection(_connStr))
            {

                conn.Open();
                string sql = "SELECT AssemblyWhen, AssemblyWho, AssemblyDevID, AssemblyTimeLength FROM ESI_AssemblyTime WHERE AssemblyDevID = 'AOS-1';";
                SqlDataReader rdr = new SqlCommand(sql, conn).ExecuteReader();

                if (!rdr.HasRows)
                {
                    rdr.Close();
                    // ADD WHAT TO DO WHEN THERE IS NO DATA
                    MessageBox.Show("No Data");
                }
                if (rdr.HasRows)
                {
                    rdr.Read();
                    while (rdr.Read())
                    {
                        if ((rdr["AssemblyWhen"] != DBNull.Value) && (rdr["AssemblyWho"] != DBNull.Value) && (rdr["AssemblyDevID"] != DBNull.Value) && (rdr["AssemblyTimeLength"] != DBNull.Value))
                        {

                            GridViewInfo info = new GridViewInfo(Aos1_GridView.MasterTemplate);
                            GridViewDataRowInfo rowInfo = new GridViewDataRowInfo(info);
                            rowInfo.Cells["PartName"].Value = rdr["AssemblyDevID"].ToString();
                            rowInfo.Cells["DateMade"].Value = rdr["AssemblyWhen"].ToString();
                            rowInfo.Cells["Employee"].Value = rdr["AssemblyWho"].ToString();
                            rowInfo.Cells["TotalTime"].Value = rdr["AssemblyTimeLength"].ToString();
                            Aos1_GridView.Rows.Add(rowInfo);
                            TB_PartsDone.Text = Aos1_GridView.Rows.Count.ToString();

                        }

                    }
                }
            }
        }
Stefan
Telerik team
 answered on 16 Jul 2012
3 answers
153 views
Hi support,

Is it possible to select a group, right-click or press the delete key, and all the lines in that group will be deleted?

Example:
GROUP1
    SUBGROUP A
        SUBSUBGROUP i
            row i1
            row i2
            row i3
        SUBGROUP ii
            row ii1
            row ii2
            row ii3
    SUBGROUP B
....

The user select SUBSUBGROUP i in the row header and press delete and the rows row i1, row i2, row i3 will be deleted.

Regards,
Nadia
Stefan
Telerik team
 answered on 16 Jul 2012
1 answer
169 views
Hi

I need put the size of the command bar to 100%.

Is there any property to do this?

Thanks,
Stefan
Telerik team
 answered on 16 Jul 2012
1 answer
447 views
Hello guys i have a problem regarding my RadButtonElement.
I have this RadButtonElement inside my GridViewCommandColumn.
here is my Code:
Private Sub rgvSKUDetails_CommandCellClick(sender As System.Object, e As System.EventArgs) Handles rgvSKUDetails.CommandCellClick
       If TypeOf rgvSKUDetails.CurrentRow Is Telerik.WinControls.UI.GridViewNewRowInfo Then
           Exit Sub
       End If
       rgvSKUDetails.Rows.RemoveAt(rgvSKUDetails.CurrentRow.Index)
   End Sub

I was Expecting that this CommandcellClick event will fire the.

Public Sub rgvSKUDetails_UserDeletingRow(sender As System.Object, e As Telerik.WinControls.UI.GridViewRowCancelEventArgs) Handles rgvSKUDetails.UserDeletingRow
Msgbox("Why Did you delete it?")
'This section here, im supposed to update the database that the
record has been deleted, but since this event is not firing is
there anyway that i could capture the event so i could update the database
that the user deleted the record?
'Perform Update to database
End Sub
i needed it because i want to update the database that the particular row was deleted by the user.

Thanks IMO
Nikolay
Telerik team
 answered on 16 Jul 2012
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
ProgressBar
CheckedDropDownList
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
Accessibility
VirtualKeyboard
NavigationView
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
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?