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. Image for the cookie policy date

How to find out the value in the cell already exists?

In GridDataBoundGrid ,When we add a value to a cell,Is there any way of locating whether the value being added is already displayed in the grid? This is like a validation which i wanted to do at the grid level. Is this possible?

1 Reply

Administrator May 5, 2003 08:59 AM UTC

You could handle then CurrentCellValidating event. In it, you can use code like: Dim cc as GridCurrentCell = Me.grid.CurrentCell Dim newValue as string = cc.Renderer.ControlText to get the new value. Once you have it, you would need to check whether this value is already in the grid. You could do this by looping through all the cells (or you could try using the GridFindReplaceDialogSink functionailty illustrated in the GridPad sample but looping will get the job done).
Loader.
Live Chat Icon For mobile
Up arrow icon