Datagrid questions

  • Thread starter Thread starter Jade
  • Start date Start date
J

Jade

Hi,

I wanted to know if anyone know how to use the first
column of the datagrid to display values that are pulled
from a database, while the second column is one where i
can add my own heading.

i.e.

i want the first column to contain all the products
(pulled from my database), while the second column
contains blank entries so the user can enter the quantity
of that product they require. the user therefore should
not be able to edit the first column but only the second
column.

Is the datagrid the best control for this?
Is it possible to achieve this using this control?

Can anyone guive me some pointers of how to approach this?

thanks
 
when you fetch data from database, fetch product code and qty column. that
would be enough.

e.g.

select productid, productname, 0 as qty from products

where qty is not a column of products table.

Regards,

Rajesh Patel
 
Hi Rajesh,

What do i do about making the first coloumn read-only
while allowing the user to enter and edit values for the
second column??

Also do u know how i can rename my datagrid headings as
they are appearing as i have stored them in my database.
I want to give them more meaningful names on my interface.

thx
 
for both of your question, you need to use datagridcolumnstyle.

you have to specify style for both columns.

there, you will have readonly = true.

you can also put a header or meaningful name for the the column.

Rajesh Patel
 
Back
Top