Click here to Skip to main content
14,303,069 members
Rate this:
Please Sign up or sign in to vote.
See more:
I am using GridView with CheckBox.

I have two tables :

document and document_rights

document table have doc.id, user_id, category, subcat
document_rights have doc.id, user_id, category, subcat

First of all I want to show all the documents in GridView from the document table and when I give user rights for the particular id it not display CheckBox true.

When button click I use code behind:


GridView1.DataSource = c.getdata("select id,user_id,title from document where category='" + drop_cat.SelectedItem.Value + "' and subctgry='" + drop_sub_cat.SelectedItem.Value + "'");
GridView1.DataBind();


And when I give rights to user I store doc.id with comma if more than one, user name and cat and subcat.

I also store user name with comma in according to doc.id in document table.

So I want to CheckBox true when user is selected from dropdown of user.

So what can I do in this case.... for check the CheckBox.
Posted
Updated 4-May-12 9:51am
v2
Comments
   
I know what is a "cat", but trying to imagine a "subcat" I start feeling horror. :-)
--SA
ZurdoDev 7-May-12 19:52pm
   
What exactly is the question?
ZurdoDev 7-May-12 19:52pm
   
Reason for my vote of 1
Also, your SQL is open for SQL injection.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100