fully editable Datagrid..not bound to database..

K

Karthik

Hello ppl

I read an article in this forum regarding constructing a datagrid not
bound to a database. My question is on those line..though not exactly
the same. Here is my problem...I have a datagrid which has columns from
2 datasets (populated from different tables in database). I constrcuted
the columns for a datagrid with these datasets.

The first dataset contains the column Serial Number. The second dataset
contains the Parameters needed to be measured for this Serial Number as
rows...which inturn have to be shown as columns in my datagrid.

Lets say

SerialNumberDataset contains column

SerialNumber(column)
Serial1
Serial2
Serial3
Serial4
Serial5

ParameterDataset contains the following
ParameterName(Column)
Parameter1
Parameter2
Parameter3

Using these two datasets I form the datagrid column by column with the
SerialNumber being a bound column and the Parameter columns being
template columns with textboxes for users to enter values.

My datagrid should look like

SerialNumber Parameter1 Parameter2 Parameter3
Serial1 (textbox) (textbox) (textbox)
Serial2 (textbox) (textbox) (textbox)
Serial3 (textbox) (textbox) (textbox)
Serial4 (textbox) (textbox) (textbox)
Serial5 (textbox) (textbox) (textbox)

where textbox is the place where user fills up data.

Finally I have a Submit button when clicked all these values are
inserted into another database table which has fields

SerialNumber ParameterName ParameterValue(textbox value)
Serial1 Parameter1 (textbox value)
Serial1 Parameter2 (textbox value)
Serial1 Parameter3 (textbox value)
Serial2 Parameter1 (textbox value)
Serial2 Parameter2 (textbox value)
Serial2 Parameter3 (textbox value)
..
..
..
..
..

etc.

So this completes my question. I hope my explanation was clear enough. I
have got the datagrid to display the way I want. But when I fill up the
textboxes and click the Submit button, my datagrid dissapears. I know it
is beacuse the page is posting back....but I dont know how to
take care of this. I have bound the datagrid in a function. If I bind
the datagrid again when click the Submit button, I lose all the data I
entered in the textboxes.

I'm completely helpless on this. I'd be grateful if you could help me on
this. If you need any more explanation I'd be pleased to do so.

Thanks in advance.
Karthik
 

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

Members online

No members online now.

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top