DataGrid redraw problem?

P

P

Hi.
Im using a floating textbox to enter data on the DataGrid. Modified an
example found on the net to do this.
My problem is this. Let say I show the editbox placed over a cell in the
grid. Enter some data and hit enter on the device which
calls a method that sets the textbox invisible again. The value of entered
text is transferred to the underlying datasource so the datarow has the
value entered
in the textbox. All is fine so far. The problem is this. Im also using a
scanner device to read text or values that should be entered in this grid.
If im still on the same row and basically in code trap a scan and enter this
new value in the same column I had previously worked with it does not
display until I change the row selection in the grid. The underlying
datasource is getting changed. My theory is that there are some redraw
problems here. After hiding the textbox this area does not seem to recognize
changes until I move row. I have tried calling Update() and Invalidate() on
the grid unsuccessfully. What could I try instead. I dont want to move rows
in code because I have code that should be executed when rowselection
changes.

Please advice

<P>
 
G

Guest

Hi

Instead of using the enter key to populate the datagrid You could use the textbox's TextChanged event to insert data into the DataGrid, that way the grid cell will get updated everytime a character is entered into the textbox

hope this helps
skicow
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top