Visual Basic .NET » Database Programming
Get values entered in Infragistics ultragrid -- moonjoor --


hi,

I am able to display values from a table onto an ultragrid. I want to allow users to enter a row of values andI want to insert tthe row in the database...can I do this? Can some give me a line of sample code to
get the value from each column in an ultragrid that the user has entered?


thanks

-- Tito --


There might be a cleaner way to do this, but this is a simple way that I have done this in the past. Capture the grid's cell value changed event. What I would then do is cycle into each column to make sure that the user has entered a value. If each cell has a value, then take the row and enter it into the database. Make sure to refresh the values in the grid with the values in the database.

Another little trick if you want the user to be able to delete a value,
create an ID column in the database for each row (you should do this anyway and place a key on it). When you query the database for the values, grab all the ID's and store them into a collection. Then capture the row removed event. Cycle into each ID in the collect that you have stored and determine which row was remove. Then simple delete the row from the database.

[Submit Comment]Home