Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
225
Delete a choosen row in UltraGrid
posted

Hello guys,

I have an UltraGrid with 5 columns and several rows.
I'd like to know if there is an option somewhere in UltraGrid properties to add a button or an icon to delete the row selected by the user.


Or if I have to create an UltraButton implemented in my class.

I'm asking this because there is an option for adding a new row and as a rookie, I was wondering if there is the same thing for the deletion.

Thanks a lot ! 

Parents
No Data
Reply
  • 21795
    Verified Answer
    Offline posted

    Hello Antony,

    Thank you for posting in our forum.

    Right now UltarGrid does not have such build in button. However if you need to implement such functionality you may add your own button. In the button click event handler call DeleteSelectedRows method of the grid. This will delete all currently selected rows in there are any.

    One more point. When you call this method the grid will pop up a message asking the user for confirmation. You can suppress this message box either by using this overload of DeleteSelectedRows:

    this.ultraGrid1.DeleteSelectedRows(false);

    or by setting ShowDeleteRowsPrompt property of the DisplayLayout to false like this:

    this.ultraGrid1.DisplayLayout.ShowDeleteRowsPrompt = false;

    More about DeleteSelectedRows method you may find by following the next link http://help.infragistics.com/Help/Doc/WinForms/2015.2/CLR4.0/HTML/Infragistics4.Win.UltraWinGrid.v15.2~Infragistics.Win.UltraWinGrid.UltraGrid~DeleteSelectedRows().html.

    Please let me know if you have any additional questions.

    Thank you for using Infragistics Components.

Children