We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





31835 Jul 15,2005 10:35 AM UTC Jul 15,2005 11:12 AM UTC WinForms 1
Tags: GridControl
Anna Srinivasan
Asked On July 15, 2005 10:35 AM UTC

Hi, I am using gridDataBoundGrid1 in my application. Q1: how do i delete selected row from gridDataBoundGrid1. [only display deletion not datatable] Help me...........!

Administrator [Syncfusion]
Replied On July 15, 2005 11:12 AM UTC

If you do not want to remove it from the DataTable, then you will have to do some work depending on what you need. If you are not sorting the grid, then you can hide the row using code like: grid.Model.RowHeights[rowIndex] = 0; If you want to sort, then hiding the row as above does not keep the row hidden when you sort it and a new row might get hidden as it moves to the row whose height is zero. In this case, one way you can hide a row is to filter it out of teh DataTable using Datatable.DefaultView.RowFilter. This means you would have to write a filter that included only the rows you want visible. This may or may not be simple depending on what rows you are trying to remove. Another option is to handle teh grid.Model.QueryRowHeight, and if e.Index points to a row you want deleted, then you can set e.handled = true and e.Size = 0. To handle sorts, you would want to use e.Index - 1 as an index into the DataView associated with the grid. Then you could check a primary key value in teh DataRowView to see if this is a row you want hidden. CurrencyManager cm = grid.BindingContext[grid.DataSource, grid.DataMember] as CurrencyManager; DataView dv = cm.List as DataView; DataRowView drv = dv[e.Index-1]; if((int)drv["pkCol"] == 18) { e.Handled = true; e.Size = 0; }


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon